Jump to content
Rtrix

Algoritm Java - Binary search trees

Recommended Posts

The 15 numbers {1, 2, 3, …, 15} can be stored in a perfectly balanced binary search tree of

height 3. Draw that tree.

Suppose the determination of “bigger, equal or smaller” is counted as one “comparison”. For

each of the above 15 numbers, state how many comparisons are required to determine

whether that number is in the search tree.

Compute the total number of comparisons C required to search for all the numbers, and hence

compute the average number of comparisons A required to search for one number.

Singura chestie pe care nu o stiu este cum sa calculez total number of comparisons si average number( dupa cateva calcule, am ajuns la faptul ca pentru a vedea daca o valoare este sau nu acolo, nr de comparatii e log(n). Putin ajutor pt mai departe?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...