Java Programming – Data Structure and Algorithms in Java

Best Book for Java :

Data Structure tutorial and Algorithms in Java with practical examples and code practices. This java data structure tutorial will cover up bunch of topics and some of them are the following:

Stack in java
Queue in java
Sorting in java
Linked list in java
Singly Linked list in java
Doubly linked list in java
Trees in java
Binary search tree in java
Hash table in java
Student Management System

Javascript Tutorial:

Facebook group:


Follow Awais On Twitter

Follow me on Twitter:

OOP in Java:

Other java tutorials:


Vaibhav Sharma says:

Hi Awais Mirza, at 1:59:33 or around, you have mentioned that right child of a parent node in the left sub-tree can have value even greater than that of its grandparent. I am doubtful about this because in some tutorials, it has been specified as a bst property that all values in left sub-tree of a root should be less than that of root node. Can you please clarify this doubt?
for reference, kindly check this link:

Guram Kankava says:

Thank you very much.

Om Prakash Jha says:

It’s a nice one. I have only one remark that why not call toHashcode() method within the insert() method of Hastable class and pass roll number as a key to insert method. I don’t see a reason to expose toHashCode method outside Hashtable class and it can be made private.

There is some additional null check as well in fetchStdData() which can be minimised as well.


dinesh b says:

Thanks brother ,…..

Saboor Hamedi says:

do you have a project with JFrame that drag and drop it not swing

sumanth varada says:

@Awais Mirza Thank you so much for such a beautiful tutorial. I have been trying to learn data structures from a long time and read few tutorials online & gain some basic understanding. But None of them given me a confidence that I can learn the data structures. Please suggest me some resources to continue this, Thank you ..!!

Viswa Chikkala says:

Also I wanted to know, How to delete lst node.Because it is not connected to ay other node address

prashant kumar says:

for pop in stack can this function be used…

Zach Stecher says:

Quick comment: For the queue ShowAll function, wouldn’t it be simpler to write a isEmpty function(the same way you did for stack) and do

while (!q.isEmpty()) { System.out.println(q.dequeue)); }

This seems cleaner to me but if there’s some reason for not doing it that I’m not seeing I’m a sponge for information. Thanks!

Harrison Katantazi says:

This helped me a lot to understand the linked lists Great job 🙂

Kamesh Emani says:

Thank you so much.. In any java interview data structures, searching & sorting algorithms play a major role..
Thanks for compiling all into a single video 🙂

Bigyan Chapagain says:

Really good stuff! I loved it.

muhammad rafiullah says:

Thank you Awais

Viswa Chikkala says:

hi, in deleting the node from linkedlist, why did you use (y==null || y.value==item); break;
when the y.value has the required item, you can delete it right, why are you breaking.

Arbi Themarajuwanabarbie says:

Hi, thank you for the video tutorial. Extremely helpful!

I have a question for the stack, in your main class you System.out.println(stack.pop()),why does the console print the value of Stack[top] (Stack[3]) which is “9”
and not the value of
Stack[top–] (Stack[2]) which is “6”?

for example in your main you popped twice and got value 9 and 6, why didn’t the console return value 6 and 4 seeming as the functions returns Stack[top–] ?

would love if you can clear this confusion for me.

muhammad rafiullah says:

kindly up load your Tutorials regarding web application development in java.

Calvin P says:

The pop implementation of stack decrements the variable top– , but it never clears the reference of the element in the array.
Shouldn’t you be setting stack[top–] = null ?

Rajguru S Javalagaddi says:

y audio is not clear ? disturbance from behind.

Dinesh Naik says:

why we need to go for customised stack instead we can use stack() right?

Mandarin Hub 加州英语 says:

The video is pretty good, but the ads in between is insane, like popping up every 3 mins or so — I hate this treehouse ads

Ullas Gokarnkar says:

can you please tell me the structure or map of videos to become complete java profesional and pls also provide algorithm and data structure with example

Dnyanesh Sawant says:

Hey! You have made a very nice and useful tutorial. The content has helped me a lot and has also enhanced my algorithmic problem solving skills. Just one suggestion that instead of making a video of complete 3 hours, make shorter videos and create a playlist. I’ll be easier for us to learn.

Berhanu Getachew Demeke says:

a very good & comprehensible tutorial for this subject which is very tough to understand
Thank you very much well done

Eddie Garcia says:

You did not use if (!PersonStack.isFull()) when pushing into the array? I am not sure if it is obvious or no but is it because you did it for IntStack so you assumed we would know to use it for PersonStack?

Matthew Malumi says:

do we ever enter the while loop in this code while inserting items into this linkedlist? because everytime node y = head is set, it means that the = 0……. im relatively new to java so im not sure if im having a brain block at the moment

public class MyIntLinkedList {

Node head;

public MyIntLinkedList() {
head = new Node();
head.value = 0; = null;

public void insertItem(int item) {
Node x = new Node();

Node y= head;
while ( != null) {
y =;
x.value = item; = null; = x;

class Node {
int value;
Node link;

John Wick says:

thanks for nice videos with beautiful explanation .

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!