This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 2008 January 23 Example Test Questions Page 1 of 23 Sample test questions for the course Fundamentals of Data Structures These questions or similar questions have been used in tests in previous years. The course has been taught using various program languages, as a consequence the program text in these examples may be written in Java, Pascal, Turing or pseudocode. The questions have not been organized by topic. 1. Remove the entry with key 40 from the binary search tree in Figure A. Draw the resulting tree. 40 5 85 31 27 38 36 52 60 71 75 65 47 Figure A A Remove the entry with key 40 from the binary search tree in Figure A. Draw the resulting tree. 2. Insert an object with key value 10 into the AVL tree in Figure B. Draw the rebalanced AVL tree after the insersion. 60 30 20 40 35 50 70 90 80 Figure B B Insert an object with key value 10 into the AVL tree in Figure B. Draw the rebalanced AVL tree after the insersion. 3. Remove the object with key value 50 from the AVL tree in Figure C. Draw the rebalanced AVL tree after the removal. 2008 January 23 Example Test Questions Page 2 of 23 60 30 20 40 35 50 70 90 80 Figure C 4. Insert an object with key value 38 into the AVL tree in Figure C. Draw the rebalanced AVL tree after the insertion. 5. Given the graph in Figure D. 1 6 7 2 3 Figure D 8 4 5 A Complete, including appropriate labels, the adjacency matrix A for the graph in Figure D. B Suppose that the FloydWarshall algorithm is used for computing the transitive closure graph of the graph in Figure D. Complete, with appropriate labels, the adjacency matrix for the resulting transitive closure graph. C Let the adjacency matrix for the graph in Figure D be denoted as A. Complete, with appropriate labels, the matrix A 3 . 6. S uppose that a boolean flag implementation is used for deciding whether an integer between 0 and 23, inclusive, belongs to the set of prime numbers or not. In addition, suppose that an array set[i], i = 0, 1, ... is used for the boolean flag implementation, where each aray element set[i] takes up 8 bits (1 byte). The space for the boolean flag implementation must be as efficient as possible. A Show the contents of the array set[i] in the boolean flag implementation. B Show how one can determine whether the integer 13 is a prime number or not using the boolean flag implementation described above. 7. State the order in which the vertices of the graph in Figure E will be traversed when the edges incident on a vertex are traversed by the alphabetic order of the adjacent vertices, and each of the following traversal algorithms is used. Start at node A. 2008 January 23 Example Test Questions Page 3 of 23 A E D G B C H F I Figure E Place your answer within the indicated boxes....
View
Full
Document
This note was uploaded on 12/11/2010 for the course CSE CSE 2011 taught by Professor Neugyen during the Winter '09 term at York University.
 Winter '09
 neugyen
 Data Structures

Click to edit the document details