



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Professor: Howe; Class: Algorithms and Data Structures; Subject: Computer Science; University: Colorado State University; Term: Fall 2007;
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




implementation?
ArrayList
T F A preorder traversal of a binary sea vertices. rch tree produces a lexicographic ordering of the T F A full (Rosen’s definition) 3-ary tree with 49 vertices has 32 leaves. T F A full (either definition) binary tree with 64 leaves has 63 internal vertices. T F A tree is a graph. T F A preorder traversal of a heap produces a lexicographic ordering of the vertices. T F A binary tree with 256 vertices has a maximum height of 8. T F A balanced tree is a complete tree.
the ADT Table. What is a Table? How can a Priority Queue be a Table?
T F in average case.A Table cannot be implemented using a linked list. T F The array [5, 18, 101, 30, 22, 202, 101] is a heap with root as minimum value. T F When a value is removed from the heap [10, 101, 12, 231, 102, 72, 1 becomes [12, 101, 231, 102, 72, 142]. 42], the array T F A semiheap is a complete binary tree. T F The rightmost leaf contains the first item to be removed from a heap implementation of a priority queue. T F Heapsort is O(n * log n) in the worst case. T F Heapsort can be made in place by iteratively constructing larger semi array becomes a heap. -heaps until the c. [10 points] Find and fix any bugs in the following code for maxheap. heapRebuild, assume it is a protected int child void =heapRebuild(int 2 * root; root) { if ( int child rightChild < items.size() = child )+ {1; if (compareItems(items.get(root), T temp = items.get(root); items.get(child)) > 0) { items.set(root, items.set(child, items.get(child)); temp); }^ heapRebuild(root); }^ }
d. [9 points] For the following graph,
i. show how it would be represented as an adjacency matrix.
ii. show the depth first traversal starting from vertex is offered, the alphabetically lower vertex is chosen and 2) the implementation is e, assuming that 1) whenever a choice recursive so that the program stack is used when backtracking.
a b c e d
f^6 (^7982)