How to Reverse a Linked List? | Iterative + Recursive | Java Placement Course

preview_player
Показать описание
01:24 - Iterative
12:50 - Recursive


Рекомендации по теме
Комментарии
Автор

Mam You are Really the best Instructor, Really your way makes DSA very easy Hope I will Meet you some day to say this to you.

aarishfaiz
Автор

these sessions help me a lot to learn java..hats up guys

manjushapatade
Автор

thanks a lot
need more videos on bst, graphs, implementations and algorithms :)

vivekbhore
Автор

mam thank you so much for this wonderful course . i studied my whole DS course from your videos . mam sending you a lot of love from Pakistan.

sameerhussain
Автор

Thank you, mam.If you can please make videos on advanced java. your lecture was very helpful to me.

nasimaaktar
Автор

Very nice explanation didi, please continue the java placement series (trees, graphs).

sindhujamaram
Автор

Thank you so much Aman bhaiya, Shradha di and all team members

kanailalmanna
Автор

THE BEST TEACHER
THE BEST CONTENT
JUST GRATEFUL ❤️

nn_yt
Автор

for (int i =list.size()-1; i >= 0 ; i--) {
int temp=list.get(i) ;
list.addLast(temp);
list.remove(i);
}
System.out.println(list);
//this is also working in Single ended Linked list

susheellattala
Автор

❤️❤️ you dii bss aap jldi jldi video uploaded kro please 🙏🙏

itsfunnytime
Автор

Thank you Ma'am.
Make a complete playlist on python please.
Your way of teaching is very nice.
Rather than others.

hareeshkumar
Автор

Plz Make video session on data structure question..it will clear all remaining doubt.

vaibhavjadhav
Автор

Linked List bahut good laga
Thanks you so much didi ❤️❤️😗

shamsher
Автор

Didi I i really inspired from your videos

onlineworld
Автор

Didi nice explanation of Reverse a linked list

uchihaPrincessSakura
Автор

Thank you so much didi watched alot of videos, asked my friend but still was confused
Thank you again 🙏

plutomessi
Автор

If you create a node( nextNode) in the loop for each iteration . May be Space complexity will be O(n)

rajeshgoudkatnam
Автор

If you initiate your currentNode from head, then there is no need to check corner cases for an empty list or a list with only one element

public static void reverseLLIteratively(){
Node previousNode = null;
Node currentNode = head; // Starts from the head of the list
Node nextNode ;

while (currentNode != null){
nextNode = currentNode.next; // Store the next node in the list
currentNode.next = previousNode; // Reverse the pointer

// update
previousNode = currentNode; // Update the previous node
currentNode = nextNode; // Move to the next node
}
head = previousNode; // Update the head to the new start of the reversed list
}

sanjaykumar-bb
Автор

very nice explanation..please continue this series again

shwetanksudhanshu
Автор

mam next time agr aap reverse link list pr vedio bnaye toh pls orginal link list jese dikhti hain na like boxes proper or address dale hue hote hain pls proper manner main smjhna kyunki thoda typical tpoic lgta h mujhe ye thoda understanding bhi deeply ho jati hain orginal linklist se may be

Yogitmamania-