|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Problems 1
Problem 1.1:
Write a function that will perform a binary search on a sorted array of
integers.
[Solution]
Problem 1.2:
Assume now that we modify the definition of a
binary search tree
slightly. All of the data in a left subtree must precede the data in
the current node, but all of the data in the right subtree must only
be greater than or equal to the data in the root node (as opposed to
exclusively greater than). Write a function that will take a new
binary search tree and return 1 or 0 for whether it contains any
duplicates.
[Solution]
Problem 1.3:
What is the worst case scenario for a binary search tree in terms of the
complexity for searching for a data element? What about for adding a new
data element?
[Solution]
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contact Us | Privacy Policy | Terms and Conditions | About
©2006 SparkNotes LLC, All Rights Reserved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||