exer5 - CMPT 307 Data Structures and Algorithms Exercises...

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

View Full Document Right Arrow Icon
CMPT 307 — Data Structures and Algorithms Exercises on Red-Black Trees. Due: Thursday, November 5th (at the beginning of the class) Reminder: the work you submit must be your own. Any collaboration and consulting outside resources must be explicitly mentioned on your submission. 1. Show that any arbitrary n -node binary search tree can be transformed into any other arbitrary n -node binary search tree using O ( n ) rotations. 2. Suppose that a node x is inserted into a red-black tree with RB-Insert and then immediately deleted with RB-Delete. Is the resulting RB-tree the same as the initial RB-tree? Justify your answer. 3. During the course of an algorithm, we sometimes Fnd that we need to maintain past versions of a dynamic set as it is updated. Such a set is called persistent . One way to implement a persistent set is to copy the entire set whenever it is modiFed, but this approach can slow down a program and also consumes much space. Sometimes,we can do better. Consider a persistent set
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

exer5 - CMPT 307 Data Structures and Algorithms Exercises...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online