Lecture 19

# Lecture 19 - ECE 2574 Introduction to Data Structures and...

• Notes
• 20

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

ECE 2574 Introduction to Data Structures and Algorithms Lecture 19: Binary Search Trees Chris Wyatt Electrical and Computer Engineering and School of Biomedical Engineering and Sciences Virginia Tech

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

Announcements Exam 2 is Wednesday April 2nd. Open Book, Open Notes Cumulative but will focus on material since Exam 1 We will do a quick review on Monday.
Recall the binary search algorithm using a sorted list.

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

We can represent the sorted list using a binary tree with a speci fi c relationship among the nodes.
This leads to the Binary Search Tree ADT. We can map the sorted list operations onto the binary search tree. Because the insert and delete can use the binary structure, they are more ef fi cient. Better than binary search on a pointer-based (linked) list.

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

Binary Search Tree (BST) Operations Consider the items of type TreeItemType to have an associated key of keyType. // create an empty BST +createBST() // destroy a BST +destroyBST() // check if a BST is empty +isEmpty(): bool
Binary Search Tree (BST) Operations

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

This is the end of the preview. Sign up to access the rest of the document.
• Fall '08
• CHuang

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern