final2007-fall

# final2007-fall - Data Structures and Algorithms(I...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Data Structures and Algorithms (I) close-book final exam Jan 18, 2008 You may answer the questions in any order. Dishonest behaviors and attempts will be punished most seriously. When you are asked to justify, prove, or disprove your answers, you may directly use anything that we have shown in class in a “black-box” manner. Problem 1 (20 points) Draw the resulting red-black tree (10 points) and 2-3-4 tree (10 points) obtained by applying the following operations in order. Let d i be the i-th digit of your student ID number from right to left. An English character is regarded as a digit. For example, if your ID number is B95902031, then d 1 = 1 , d 2 = 3 , d 3 = 0 , and d 9 = 0 . • insert 10 * d 1 + 1 , 11 * d 2 , d 2 3 , 40 + d 4 , 50 + d 5 . • insert 3, 7, 9, 27, 23, 69, 47, 38. • delete 3, 69, 27, d 2 3 . • insert 69, d 2 3 . For the part of red-black tree, you do not have to draw the dummy leaves, However, you have to specify the color of each node. No need to show the intermediate steps. Only the final drawings count. An instruction to insert an existing number, if any, has to be ignored.count....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

final2007-fall - Data Structures and Algorithms(I...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online