Video is locked.

Unlock this course with a free trial

Join today to access over 15,000 courses taught by industry experts.

Introduction to Data Structures & Algorithms in Java

Time complexity of operations on binary search trees

From the course: Introduction to Data Structures & Algorithms in Java

  • Course details

    Enhance your programming skill set by learning about some of the most commonly-used data structures and algorithms. In this course, instructor Raghavendra Dixit walks through how to use Java to write code to implement data structures and algorithms. After explaining why it's advantageous to study these topics, he goes over the analysis of algorithms and discusses arrays—a data structure found in most programming languages. He also explains how to implement linked lists in Java, and covers stacks, queues, recursion, binary search trees, heaps, and more.

    Note: This course was created by Packt Publishing. We are pleased to host this training in our library.


    • Click here to view Raghavendra Dixit’s instructor page

      Raghavendra Dixit

      • Raghavendra Dixit is an entrepreneur and technical architect with over 15 years of programming experience.

        A graduate of the Indian Institute of Technology, Raghavendra has worked in both product and service-based software companies. He has worked with languages such as Perl, Java, Objective-C, Scala, and JavaScript. He has also used various frameworks and platforms, including Spring, Play, Cocoa, and Android. In his free time, he likes to create technical content that's easy to follow, and helps people in the software industry enhance their skills and accelerate their careers.

    Skills covered in this course

  • Introduction

    - [Narrator] Now we come to the last part of this chapter, where we look at the time complexity of insert, delete and search operations on binary search trees and of course, when we analyze these operations we assume that the binary search tree is perfectly balanced, alright. So let's start with searching for an item. Now, when we look for an item or some data, what do you think will happen in the worst-case? Well we always start from the root, right? And then based on whether the data to be found is greater than or less than the data at a node, we pick one of the children and check there until a node does not have any children, right. And that happens in the last layer of the tree where we have all the leaves, assuming we have a perfectly balanced tree. And the data could be present in one of those leaf nodes. So in each layer we do a comparison and then move on to the next layer. So in the worst case, we will be doing memory access proportional to the height of the tree, right? So…

  • Practice while you learn with exercise files

    Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.

    Download the exercise files for this course. Get started with a free trial today.

  • Download courses and learn on the go

    Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.

    Watch this course anytime, anywhere. Get started with a free trial today.