Introduction To Data Structures Algorithms In Java

Designed to help understand the fundamentals of DS & Algorithms really well. A must have for programming interviews.

Last updated 2022-01-10 | 4.5

- Be able to know and implement various data structures and algorithms
- Be able to write your own algorithms and understand if their running time is good or bad

What you'll learn

Be able to know and implement various data structures and algorithms
Be able to write your own algorithms and understand if their running time is good or bad

* Requirements

* Although any programming language may be used by the student
* we use the java programming language to implement algorithms.

Description

This course introduces some basic data structures (arrays, linked lists, stacks, queues, trees and heaps) and algorithms (various sorting algorithms, and algorithms for operations on binary search trees and heaps). We will also cover recursion in this course. Use of graphics and animations makes the lectures very easy to understand and digest. After taking this course, you will loose your fear for data structures and algorithms.

Who this course is for:

  • Anyone who wants to learn data structures and algorithms (introductory)
  • Anyone appearing for interviews, can be used to understand from grounds up, or as a quick revision

Course content

10 sections • 113 lectures

Introduction Preview 01:08

Euclid's algorithm Preview 04:49

Bubble Sort algorithm Preview 02:52

Why study data structures & algorithms Preview 03:10

Correctness of an algorithm Preview 01:35

Chapter Quiz

Note on this section Preview 00:43

Introduction Preview 03:20

How to calculate the time complexity Preview 02:52

The RAM model of computation Preview 02:07

Time complexity of Bubble sort algorithm Preview 03:25

Pseudo code : Bubble sort algorithm Preview 03:02

The Big O notation Preview 03:26

Using Big O notation : Examples Preview 04:41

Comparison of running times Preview 04:02

Chapter Quiz

Selection Sort Preview 02:48

Selection Sort : Pseudocode Preview 02:34

One of the problems that people face in writing algorithms is how to translate their thoughts into a programming language. Many people cannot even start writing the very first statement of an algorithm. I suggest that if you are having such trouble, don't try to solve the whole problem together, rather break it down into smaller, easier parts. For e.g. try doing the following in writing code for the selection sort algorithm -

  • First try to write a method, which just finds the minimum number in the data array. Don't think about anything else, just that method. If you write it in a different method, then you may need to pass the data array as a parameter to that method. Return the index of that minimum element from this method.
  • Now change the method to find the minimum number STARTING FROM A PARTICULAR INDEX. So you will need to pass this index as a parameter.
  • Write another method which can swap items in an array, located at two different indexes. What parameters should be passed to this method?

Hopefully, by this time you will have enough clarity on completing the sorting algorithm, if you understood the pseudo code.

Introduction to Insertion Sort Preview 01:56

Applying Insertion Sort algorithm to cue balls Preview 02:08

Insertion Sort: Pseudocode Preview 02:38

O(n²) sorting algorithms - Comparison Preview 02:00

In place sorting Preview 00:58

Stable Vs Unstable Sorts Preview 03:46

Searching elements in an un ordered array Preview 03:16

Searching elements in an ORDERED array Preview 02:33

Searching elements in an ORDERED array - contd. Preview 05:48

Inserting and Deleting items in an ORDERED array Preview 02:08

Sorting any type of object Preview 01:33

Try to write generic sort methods, like shown in the InsertionSortWithGenerics.java, for Bubble sort and Selection sort algorithms as an exercise. But if you don't want to get into generics at this point, you may choose to skip this section.

Chapter Quiz

Assignment Preview 00:52

What is a Linked List? Preview 03:21

Implementing a Linked List in Java Preview 00:56

Inserting a new Node Preview 05:25

Length of a Linked List Preview 02:11

Deleting the head node Preview 02:11

Searching for an Item Preview 03:11

Using java generics to parameterize the LinkedList Preview 02:09

Doubly Ended Lists Preview 03:05

Inserting data in a sorted Linked List Preview 04:38

Doubly Linked List Preview 06:28

Insertion Sort revisited Preview 10:32

Chapter Quiz

Assignment Preview 01:02

Stacks Preview 02:41

Abstract Data Types Preview 00:37

Implementing Stacks using Arrays Preview 03:21

Queues Preview 02:32

Queues using Arrays Preview 05:29

Double Ended Queues Preview 01:58

Double Ended Queues using Arrays Preview 04:20

Chapter Quiz

Assignment Preview 00:52

Introduction Preview 04:33

Understanding Recursion Preview 03:04

Tail recursion Preview 02:48

Tower of Hanoi Preview 08:25

Tower of Hanoi - Implementation Preview 02:58

Merge Sort Preview 04:09

Merge Sort - Pseudocode Preview 04:24

Merge Step - Pseudocode Preview 04:32

Time Complexity of Merge Sort Preview 02:52

Chapter Quiz

Assignment Preview 00:37

The Tree Data structure Preview 03:41

Binary Trees Preview 03:34

Binary Search Trees Preview 02:01

Finding an item in a Binary Search Tree Preview 02:24

Implementing the find method Preview 03:02

Inserting an item in a Binary Search Tree Preview 03:34

Deleting an Item : Case 1 Preview 06:06

Deleting an Item - Case 2 Preview 02:58

Deleting an Item - Case 3 Preview 03:44

Deleting an Item - Soft Delete Preview 01:40

Finding smallest & largest values Preview 02:33

Tree Traversal : In Order Preview 03:19

Tree Traversal : Pre Order Preview 01:58

Tree Traversal : Post Order Preview 00:56

Unbalanced Trees Vs Balanced Trees Preview 02:16

Height of a Binary Tree Preview 01:34

Time Complexity of Operations on Binary Search Trees Preview 02:16

Chapter Quiz

Assignment Preview 00:21

Introduction Preview 01:27

QuickSort Preview 04:54

QuickSort: The partition step Preview 02:21

Shell Sort Preview 05:27

Shell Sort: Example Preview 03:28

Counting Sort Preview 04:50

Radix Sort Preview 02:27

Bucket Sort Preview 03:12

Chapter Quiz

Assignment Preview 00:11

Introduction Preview 04:06

Deleting the root Preview 01:54

Inserting an item in a heap Preview 01:59

Heaps as Priority Queues Preview 02:30

Representing heaps using Arrays Preview 01:55

Heap Sort Preview 02:30

Building a heap Preview 04:07

Chapter Quiz

Assignment Preview 00:08

Introduction Preview 02:41

Direct Access Tables Preview 02:04

Hashing Preview 01:37

Resolving collisions through chaining Preview 04:16

The Hash function Preview 06:16

Open Addressing to resolve collisions Preview 02:58

Strategies for Open Addressing Preview 03:19

Time Complexity: Open Addressing Preview 03:20

Chapter Quiz

Assignment Preview 00:26

Conclusion Preview 00:59

This last lecture also contains the complete project file (zipped) in the downloadable materials section.