Join Raghavendra Dixit for an in-depth discussion in this video Deleting an item: Case 1, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] Let's see another operation…on binary search trees.…How to delete a node.…The delete operation is quite complicated…compared to the commonly used operations…performed on a binary search tree.…The first step in deleting the node,…as you can guess, is to find the node to be deleted.…After that there are three cases to be considered.…The first one is that the node to be deleted is a leaf.…That is it has no children.…
Then the second case is when the node…to be deleted has one child.…And the third case is that when the node…to be deleted has two children.…And we have to deal with these cases…because we need to rearrange the children…of the deleted node so that the binary…search tree property's maintained.…The first case is when the node to be deleted is a leaf.…So, say we have to delete the node 34.…First we search the node containing 34.…
So, we start at the root…and search for the node like we saw earlier.…After finding the node,…we check if it is a leaf…and here in this example node 34 is a leaf.…That is this node does not have any children.…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Why study data structures and algorithms?
- How to calculate the time complexity
- Using Big O notation
- Using basic sorting and search algorithms
- Searching elements in unordered arrays and ordered arrays
- Implementing a linked list in Java
- Implementing stacks using arrays
- Queues using arrays
- Binary search trees
- Representing heaps using arrays
Skill Level Intermediate
1. Introduction to Algorithms
2. Analysis of Algorithms
3. Basic Sorting and Search Algorithms
4. Linked Lists
5. Stacks and Queues
7. Binary Search Trees
8. More Sorting Algorithms
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.