Join Raghavendra Dixit for an in-depth discussion in this video Implementing the find method, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] Now it is quite easy to implement search…or find if we do it regressively, all right?…Let's first go to our binary three class…and rename it to binary search tree.…Because as explained earlier, we are leading…with the binary search tree data structure.…So let us select the class name by double clicking on it,…then right click, go to the refactor menu item…and select rename.…And now let's rename it to Binary Search Tree, all right?…So let's implement the find method…inside the TreeNode class, all right.…
And we do this because we want to find an item regressively.…And if you don't understand it just hold on a little…and lets implement it and you should be able…to understand what we are doing.…So we write the find method…and the first thing to do is to check…if the data contained in this Node object is…equal to the integer data we are looking for.…And if it is equal, we just return this node object, right?…Now, if the integer data we are looking for…is less than the current node's data…then where should we look?…
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.