Question

Data Structures and Algorithms What is the: a. maximum number of levels that a binary search...

Data Structures and Algorithms

  1. What is the:
    a. maximum number of levels that a binary search tree with 100 nodes can have?
    b. minimum number of levels that a binary search tree with 100 nodes can have?
    c. maximum total number of nodes in a binary tree that has N levels? (Remember that the root is level 0.)
    d. maximum number of nodes in the Nth level of a binary tree?
    e. number of ancestors of a node in the Nth level of a binary search tree?
    f. number of different binary trees that can be made from three nodes that contain the key values 1, 2, and 3?
    g. number of different binary search trees that can be made from three nodes that contain the key values 1, 2, and 3?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) Berch tho manimum mumbr d lavels that a bena ty wilh 100 madis ean have is 99. in drder to monimize th mumbur laels, wr meThe minimiin poorens e. eachuce hos one aud e BST would look omethg eno child liko and th lvel o Level 98 lerl 2 lovel 98 lovHoor (loy to1))6. manimun total mumba of mods that hos N lovrls ina March manimum tool numbr af Acl ina ods of Lwel i should

a) Berch tho manimum mumbr d lavels that a bena ty wilh 100 madis ean have is 99. in drder to monimize th mumbur laels, wr med to minimiz uumbr al modes af each lvrl. Jhe minimum Mumber Aay afoch level can be 1. pareut euo child uodo X-e. eachucc how one aud liks BST would laok omei and the level o level Lovel 99 (e) thiminimum numbur lwels thol a u wilh 10o ods cau hauwe i Searuh in dn to minimiz mbr luels, we have to amoximiz mumbr d medes of each Bwel Nades aj lw cau b aN ho mauimum Mumbur th tu has M lvel, whuh sthe minimum can kawe

The minimiin poorens e. eachuce hos one aud e BST would look omethg eno child liko and th lvel o Level 98 lerl 2 lovel 98 lovel 99. search luels thol a b) Thminimum mbur tu wlh 100 nods can have i lurls, we have to in order to minimiz br nedes of each lwel monimizs mumbr Nos al Lud N cau be 2 he mauimum Mumber W tw hos m lved, whuh sthe minimum can howe hon 2 100 a"- 2 1017"

Hoor (loy to1))6. manimun total mumba of mods that hos N lovrls ina March manimum tool numbr af Acl ina ods of Lwel i should lal mouimum a N lwels s BST henee tolol no. Modes in th 24214242N pring G.P Aum (G.P.: Gyeometi a Phopeni) -) 2-20 (d) man mumum mumbur d wodus n th Nh lavd of tivany,s

Add a comment
Know the answer?
Add Answer to:
Data Structures and Algorithms What is the: a. maximum number of levels that a binary search...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ Data Structures and Algorithms Binary Trees: Implementation Answer the following question(s) concerning implementing recursive functions...

    C++ Data Structures and Algorithms Binary Trees: Implementation Answer the following question(s) concerning implementing recursive functions to perform operations on linked lists of nodes arranged as binary trees. For these questions, use the following struct definition for the nodes of the tree (we will not templatize the node here, so you do not have to write template functions for these questions, just assume trees of <int>values): struct BinaryTreeNode { int item; BinaryTreeNode* left; BinaryTreeNode* right; }; Write a recursive function...

  • Algorithms and Data Structures Let T be a binary search tree which implements a dictionary. Let...

    Algorithms and Data Structures Let T be a binary search tree which implements a dictionary. Let v be a node of T, and T_v be the subtree rooted at v. Design a recursive algorithm CountLE(v, k) which, given an input node v and a key k, returns the number of entries in T_v with key at most k.

  • java data structures and algorithms    binary trees part thank you very much Dagger Given a binary...

    java data structures and algorithms    binary trees part thank you very much Dagger Given a binary tree and a sum, the method has PathSum determines if the tree has a squareroot-to-leaf path such that adding up all the key values along the path equals the given sum. It uses an auxiliary method which takes the squareroot of the given tree to do its job as follows: public boolean hasPathSum(int sum){ return hasPathSum(root, sum); } Given the following tree where the...

  • QUESTION 9 Consider the following binary search tree: If the root node, 50, is deleted, which node will become the new root?   A 15 B 24 C 37 D 62    QUESTION 10 In the...

    QUESTION 9 Consider the following binary search tree: If the root node, 50, is deleted, which node will become the new root?   A 15 B 24 C 37 D 62    QUESTION 10 In the following trees EXCEPT______, the left and right subtrees of any node have heights that differ by at most 1. A complete trees B perfect full trees C balanced binary trees D binary search trees    QUESTION 11 A perfect full binary tree whose height is 5 has...

  • Draw the tree resulting from inserting the following values into a binary search tree in order...

    Draw the tree resulting from inserting the following values into a binary search tree in order without re-balancing: 40, 10, 60, 30, 20, 90, 70, 50 Null pointers can be omitted as long as it is clear whether a single child is a left or right child. THEN For every node in the tree, the values that can be in the subtree rooted at that node are constrained by ancestors to be in some range of integers. The root (the...

  • A balanced binary tree is a binary tree structure in which the left and right subtrees of every node differ

    Data structures C++1- A balanced binary tree is a binary tree structure in which the left and right subtrees of every node differ in height by no more than 1 Out of the following choices, which is the minimum set of nodes, if removed, will make the BST balanced?2- Which of the following is true for Red-Black Trees ? Select all choices that apply! Select one or more: a. For each node in the tree, all paths from that node to any leaf nodes contain...

  • Design a divide-and-conquer algorithm for computing the number of levels in a binary tree. In particular,...

    Design a divide-and-conquer algorithm for computing the number of levels in a binary tree. In particular, the algorithm should return 0 and 1 for the empty and single-node trees respectively. Please provide the pseudocode for your algorithm. What is the running time of your algorithm in the worst case using O() notation? Design a divide-and-conquer algorithm for computing the number of levels in a COMPLETE binary tree. In particular, the algorithm should return 0 and 1 for the empty and...

  • 1 Binary Search Trees (25 points) Consider the binary tree as shown in Figure 1. 9...

    1 Binary Search Trees (25 points) Consider the binary tree as shown in Figure 1. 9 5 15 10 17 8 Figure 1: Binary Tree: The letter next to each node (e.g., a, b) denotes the tree node, and the number inside each node is the key. 1.1 Correctness (10 points) Is this binary tree a valid binary search tree? In other words, does it satisfy the binary search tree property? If not, which node(s) violates the binary search tree...

  • Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of...

    Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of height h is 2h+1 − 1. 2. A full node is a node with two children. Prove that the number of full nodes plus one is equal to the number of leaves in a nonempty binary tree. 3. What is the minimum number of nodes in an AVL tree of height 15? 4. Show the result of inserting 14, 12, 18, 20, 27, 16,...

  • Beginning with an empty binary search tree, what binary search tree is formed when you add the following letters in the order given?

    Trees-related questionsBeginning with an empty binary search tree, what binary search tree is formed when you add the following letters in the order given? J, N, B, A, W, E, TRepresent the following binary tree with an array  What is the result of adding 3 and 4 to the 2-3 tree shown below?Why does a node in a red-black tree require less memory than a node in a 2-3-4 tree?Why can’t a Red-Black Tree have a black child node with exactly...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT