Join Raghavendra Dixit for an in-depth discussion in this video Tree traversal: In order, part of Introduction to Data Structures & Algorithms in Java.
- [Instructor] One of the things that we want to do…in case of a binary tree data structure…is to go through all the nodes of a tree.…Maybe to print the node values or do some operations.…The point is, we need to be able to go through…all the nodes inside a binary tree.…The three most common ways to traverse a binary tree…are these: in-order, pre order, and post order.…In-order traversal is probably one of the easiest…and most commonly used way of traversing a binary tree.…
Pre order and post order traversals are usually required…for compiled kind of programs where the program…has to go through the abstract syntax tree…or evaluate expressions, et cetera.…We will not get into these kinds…of details in this course, though.…So let's start with in-order traversal.…In case of in-order traversal,…we first traverse the left sub tree,…and this is done recursively.…So first we traverse the left sub tree,…then we go to the root of the tree,…and finally we traverse the right sub tree recursively.…
So if we had only these three nodes in the tree as shown,…
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.