COP 3530 Quiz 13
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. If the root is consider level 0, what is the level of the node containing the value 15?
1
We are given a set of n distinct elements and an unlabeled binary tree with n nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree?
1
If a tree satisfies the ____ property such that if P is a parent node of C, then the key value of Node P is greater than the key value of Node C. The data type is called a _____.
Heap
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. If the root is consider level 0, what is the level of the node containing the value 16?
2
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. If the root is consider level 0, what is the level of the node containing the value 3?
2
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
233168
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. If the root is consider level 0, what is the level of the node containing the value 5?
3
While inserting the elements 71, 65, 84, 69, 67, 83 in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is
67
Watch the video at https://www.youtube.com/watch?v=tYPUvEZF8XE in the tree using in-order traversal, what is the last node visited?
B22
Watch the video at https://www.youtube.com/watch?v=tYPUvEZF8XE in the tree using pre-order traversal, what is the last node visited?
B22
Mergesort is an example of which type of algorithmic approach.
Divide and Conquer
No binary tree is both complete and full
False
Which of the following traversal outputs the data in sorted order in a BST?
Inorder
What is the worst case time complexity for search, insert and delete operations in a general Binary Search Tree?
O(n) for all
Watch the video at https://www.youtube.com/watch?v=tYPUvEZF8XE in the tree using post-order traversal, what is the last node visited?
R
Watch the video at https://www.youtube.com/watch?v=tYPUvEZF8XE in the tree using pre-order traversal, what is the first node visited?
R
If arity of operators is fixed, then which of the following notations can be used to parse expressions without parentheses? a) Infix Notation (Inorder traversal of a expression tree) b) Postfix Notation (Postorder traversal of a expression tree) c) Prefix Notation (Preorder traversal of a expression tree)
b and c