Test Questions
Test Questions
1) Which of the following ADT is value-oriented? a) list b) sorted list c) stack d) queue e) binary tree 2) The ADT stack manages an association between data items and the ______ of the data items. a) names b) values c) sizes d) positions 3) The operations of the ADT sorted list are based upon the ______ of data items. a) names b) values c) sizes d) positions 4) The ______ is a position-oriented ADT that is not linear. a) sorted list b) queue c) binary tree d) list 5) Which of the following ADT is position-oriented? a) binary tree b) sorted list c) table d) priority queue 6) A node of a tree is called a(n) ______. a) edge b) root c) branch d) vertex 7) The lines between the nodes of a tree are called ______. a) branches b) edges c) arches d) subtrees 8) The node that is directly above node n in a tree is called the ______ of node n. a) root b) leaf c) parent d) child
Fall 2011
Fall 2011
20) Which of the following is NOT a property of a complete binary tree of height h? a) all nodes at level h 2 and above have two children each b) when a node at level h 1 has children, all nodes to its left at the same level have two children each c) when a node at level h 1 has one child, it is a left child d) all leaves are at level h 21) The traversal of a binary tree is ______. a) O(n) b) O(1) c) O(n2) d) O(log2n) 22) In an array based representation of a complete binary tree, which of the following represents the left child of node tree[i]? a) tree[i+2] b) tree[i2] c) tree[2*i+1] d) tree[2*i+2] 23) In an array based representation of a complete binary tree, which of the following represents the right child of node tree[i]? a) tree[i+2] b) tree[i2] c) tree[2*i+1] d) tree[2*i+2] 24) In an array based representation of a complete binary tree, which of the following represents the parent of node tree[i]? a) tree[i2] b) tree[(i1)/2] c) tree[2*i1] d) tree[2*i2] 25) A data element within a record is called a ______. a) field b) tree c) collection d) key
Fall 2011
Fall 2011