Lab 11

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Binary Search Tree

Course Code: CSC 2107 Course Title: Data Structure (Lab)

Dept. of Computer Science


Faculty of Science and Technology

Lecturer No: 11 Week No: 11 Semester:


Lecturer: Name & email
Rules and Guidelines

Write your own rules to evaluate lab tasks.


Prerequisites

 Have a clear and full understanding of Binary Search Tree (BST)

 Deletion from BST.

 Theory Lectures 10.1


Objectives

 To implement Binary Search Tree deletion for all three cases such as
 Deletion of leaf nodes
 Deletion of nodes with one child
 Deletion of nodes with both children
Lab Tasks

1. Extend the code of previous lab task to implement Binary


Search Tree deletion

**perform time complexity for the above program


BST: Deletion

Do the following to write program for a BST:


Extend the previous lab task to implement deletion operation
There are three cases when you delete a node.
Case 1: Node with zero child (Leaf node)
Case 2: Node with one child
Case 3: Node with both children

Implement the logic of 3 cases one by one.


Home Task

Extend the home task of previous lab task to implement deletion


of student data
References
1. Theory Lecture 10.1

2. https://en.wikipedia.org/wiki/Binary_Search_Tree
Books
 “Schaum's Outline of Data Structures with C++”. By John R. Hubbard
 “Data Structures and Program Design”, Robert L. Kruse, 3rd Edition, 1996.
 “Data structures, algorithms and performance”, D. Wood, Addison-Wesley, 1993
 “Advanced Data Structures”, Peter Brass, Cambridge University Press, 2008
 “Data Structures and Algorithm Analysis”, Edition 3.2 (C++ Version), Clifford A.
Shaffer, Virginia Tech, Blacksburg, VA 24061 January 2, 2012
 “C++ Data Structures”, Nell Dale and David Teague, Jones and Bartlett Publishers,
2001.
 “Data Structures and Algorithms with Object-Oriented Design Patterns in C++”,
Bruno R. Preiss,

You might also like