Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. A binary search tree is a binary tree with the added property that the left c

ID: 3547846 • Letter: 1

Question

1.    A binary search tree is a binary tree with the added property that the left child is less than the parent, which is less than or equal to the ___________.

A.   Left child

B.   Right child

C.   Middle child

D.   None of the above

2.    The definition of a binary search tree is an extension of the definition of a ______________.

A.   stack

B.   queue

C.   list

D.   binary tree

3.    Each BinaryTreeNode object maintains a reference to the element stored at that node as well as references to each of the nodes __________.

A.   children

B.   siblings

C.   ancestors

D.   None of the above

4.    In removing an element from a binary search tree, another node must be ___________ to replace the node being removed.

A.   duplicated

B.   demoted

C.   promoted

D.   None of the above

5.    The leftmost node in a binary search tree will contain the __________ element, while the rightmost node will contain the __________ element.

A.   Maximum, minimum

B.   Minimum, maximum

C.   Minimum, middle

D.   None of the above

6.    One of the uses of trees is to provide _________ implementations of other collections.

A.   efficient

B.   easy

C.   useful

D.   None of the above

7.    If a binary search tree is not __________, it may be less efficient than a linear structure.

A.   complete

B.   empty

C.   balanced

D.   None of the above

8.    Since a heap is a complete tree, there is only one correct location for the insertion of a new node, and that is either the next open position from the left at level h or the first position on the left at level h+1 if level h is full.

A.   Minheap

B.   Maxheap

C.   Balanced tree

D.   Complete tree

9.    Typically, in heap implementations, we keep track of the position of the last node or, more precisely, the last leaf in the tree.

A.   root

B.   internal node

C.   leaf

D.   tree

10. To maintain the completeness of the tree, there is only one valid element to replace the ________, and that is the element stored in the last leaf in the tree.

A.   root

B.   internal node

C.   leaf

D.   tree

11. An undirected graph is a graph where the pairings representing the edges are _____________.

A.   Unordered

B.   Ordered

C.   Sorted

D.   None of the above

12. Two vertices in a graph are ___________ if there is an edge connecting them.

A.   Connected

B.   Adjacent

C.   Ordered

D.   None of the above

13. An undirected graph is considered complete if it has the maximum number of edges connecting vertices.

A.   Connected

B.   Adjacent

C.   Complete

D.   Full

14. A _________ is a sequence of edges that connects two vertices in a graph.

A.   Connection

B.   Path

C.   Set

D.   Cycle

15. A ________ is a path in which the first and last vertices are the same and none of the edges are repeated.

A.   Connection

B.   Path

C.   Set

D.   Cycle

16. An undirected tree is a connected, acyclic, undirected graph with one element designated as the _______.

A.   Starting point

B.   Root

C.   Leaf

D.   Cycle

17. What is the difference between a binary tree and a binary search tree?

18. What imbalance is fixed by a single right rotation?

19. What is the difference between a minheap and a maxheap?

20. What is the difference between a heap (a minheap) and a binary search tree?

21. What is the difference between a set and a map?

22. What does it mean to say that a graph is complete?

Explanation / Answer

1)B

2)D
3)A

4)C
5)B
6)A
7)C
8)C
9)A
10)B
11)A
12)A
13)C
14)B
15)D
16)B
17)In binary search tree the left child must be less than parent and right child must be greater than parent and it should be binary tree
Left child < Parent < Right Child
Where there is no such convention for binary tree
The only rule for binary tree is every node of the tree should contain atmost two childs

18)Suppose the tree is of the following
                     3

                    /

                  /

                2

              /

            /

          1

The this imbalance is fixed by Single rotation

19)In max heap every child is less than its parent
Whereas in min heap every child is greater than its parent

20)In min heap every child is greater than parent but in binary search tree only one child is greater than parent ( other one is less than parent )
21)Set doesn't allow duplicates, while Map provides a data structure based on key value pair and hashing.
22) A graph is said to be complete if there exists a edge between any two vertices
That is ther should be n(n-1)/2 edges in the graph
where n is number of vertices in graph