Algorithm Development Quiz
Algorithm Development QUIZ
QUESTION 1
1. Suppose T1(N) = O(f(N)) and T2(N) = O(f(N)). Which of the following are true?
Write the letter for the correct answer in the space below.
QUESTION 2
1. Given two sorted lists, L1, and L2, write a procedure to compute L1 ∩ L2 using only the basic list operations.
QUESTION 3
1. Show the result of:
· Inserting 3,1,4,6,9,2,5,7 into an initially empty binary search tree.
· Show the result of deleting the root.
QUESTION 4
1. Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x(mod() 10), show the hash table using linear probing.
QUESTION 5
1. Show the result of inserting keys 1 to 15 in order into an initially empty leftist heap. Complete a table that looks like this:
QUESTION 6
1. Explain when the following should be utilized. Provide a real or hypothetical example of each that is not in the textbook.
· Greedy algorithms
· Divide and Conquer
· Dynamic programming
ALGORITHM DEVELOPMEN
T
QUIZ
QUESTION 1
1.
Suppose T1(N) = O(f(N)) and T2(N) = O(f(N)). Which of the following are true?
Writ
e the letter for the correct answer in the space below.
QUESTION 2
1.
Given two sorted lists, L1, and L2, write a procedure to compute L1
n
L2 using only the
basic list operations.
QUESTION 3
1.
Show the result of:
·
Inserting 3,1,4,6,9,2,5,7 into an initially empty binary search tree.
·
Show the result of deleting the root.
QUESTION 4
1.
Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x)
= x(mod() 10), show the hash table using linear probing.
QUESTION 5
1.
Show the result of inserting keys 1 to 15 in order into an initially empty leftist heap. Complete a table
that looks like this:
ALGORITHM DEVELOPMENT QUIZ
QUESTION 1
1. Suppose T1(N) = O(f(N)) and T2(N) = O(f(N)). Which of the following are true?
Write the letter for the correct answer in the space below.
QUESTION 2
1. Given two sorted lists, L1, and L2, write a procedure to compute L1 n L2 using only the
basic list operations.
QUESTION 3
1. Show the result of:
Inserting 3,1,4,6,9,2,5,7 into an initially empty binary search tree.
Show the result of deleting the root.
QUESTION 4
1. Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x)
= x(mod() 10), show the hash table using linear probing.
QUESTION 5
1. Show the result of inserting keys 1 to 15 in order into an initially empty leftist heap. Complete a table
that looks like this: