Quiz 5 structures
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)?
2
What is the value of the following prefix expression " ++ 26 + - 1 3 2 4" ? (consider spaces between the last 4 digits. Treat them as an individual number)
30
What is the worst case time complexity for search, insert and delete operations in a general Binary Search Tree?
O(n)
In a preorder traversal of a binary search tree, the first item printed out is always the smallest one
false
The maximum number of nodes in a tree that has L levels is 2^L
false, 2^L-1
In the following Binary Tree is not a Heap, why?
heap order property not satisfied
Tree operations typically run in O(d) times where d is the number of nodes in the tree.
true
In a heap, the left child of a node is always less than the right child of a node
False
Which of the following traversal outputs the data in sorted order in a BST? Inorder Preorder Postorder Level order
Inorder