Professional Documents
Culture Documents
Data Structures Test Part 3 Review: O (N) O (Log2 N) O (N Log2 N) O (1) O (N N)
Data Structures Test Part 3 Review: O (N) O (Log2 N) O (N Log2 N) O (1) O (N N)
a. O(N )
b. O(Log2 N)
c. O(N * log2 N )
d. O(1)
e. O(N*N )
ANS: B
a. O(N )
b. O(Log2 N)
c. O(N * log2 N )
d. O(1)
e. O(N*N)
ANS: D
3. Which of these is the correct BigO for adding an item to the front of an array?
a. O(N )
b. O(Log2 N)
c. O(N * log2 N )
d. O(1)
e. O(N*N)
ANS: A
4. Which of these is the correct BigO for adding an item to the end of an array?
a. O(N )
b. O(Log2 N)
c. O(N * log2 N )
d. O(1)
e. O(N*N)
ANS: D
How many children can the root node of binary tree have?
A. 2
B. 3
C. 1
D. 0
E. 4
ANS: A
A. inorder
B. preorder
C. postorder
D. reverse
E. funorder
ANS: A
A. inorder
B. preorder
C. postorder
D. reverse
E. funorder
ANS: D
A. inorder
B. preorder
C. postorder
D. reverse
E. funorder
ANS: C
A. inorder
B. preorder
C. postorder
D. reverse
E. funorder
ANS: B
A. 3
B. 5
C. 1
D. 4
E. 2
ANS: E
If you insert the following numbers in the order listed into a binary search tree, which of the
following represents the tree’s in order traversal output?
Items inserted in the following order : 200 150 225 75 210 250
If you insert the following numbers in the order listed into a binary search tree, which of the
following represents the tree’s pre order traversal output?
Items inserted in the following order: 200 150 225 75 210 250
If you insert the following numbers in the order listed into a binary search tree, which of the
following represents the tree’s post order traversal output?
Items inserted in the following order : 200 150 225 75 210 250
If you insert the following numbers in the order listed into a binary search tree, which of the
following represents the tree’s reverse order traversal output?
Items inserted in the following order: 200 150 225 75 210 250
Given each heap tree, draw what will the tree look like after:
16. 12 is added
15
20 32
22 30 44 50
25 32 40
17. 42 is added
15
20 32
22 30 44 50
25 32 40
18. 5 is added
15
20 32
22 30 44 50
25 32 40
A. Node representations
B. Adjacency List
C. Algorithm
D. Incidence Matrix
20. The number of edges with one endpoint on a given vertex is called ____________.
A. Directed Graph
B. Vertex’s degree
C. Adjacency Matrix
A. Nodes
B. Lines
C. Edges
D. Roads