Reverse a Singly Linked List in Java | Leetcode

  Рет қаралды 151,700

Dinesh Varyani

Dinesh Varyani

8 жыл бұрын

►Full DSA Course - • Data Structures and Al...
►Follow me on Instagram - bit.ly/intrvwkckstrt
►Follow me on LinkedIn - bit.ly/fllwlkdn
►Enroll in the complete course: bit.ly/3W4qthg
►Source Code - github.com/dinesh-varyani/ds-...
►Download DSA Animation Slides - techready.in/courses/150-dsa-...
►Click here to subscribe - kzfaq.info...
Watch all my playlist here:
►Data Structures and Algorithms Course playlist: • Data Structures and Al...
►Mastering JUnit 5 - kzfaq.info?list...
►Mastering Mockito 3 - • Mockito 3 Tutorials
►Analysis of Algorithms - • Analysis of Algorithms
►Linked List Data Structures - • Linked List Data Struc...
►Array Data Structures - • Playlist
►Stack Data Structure - • Stack Data Structure
►Queue Data Structure - • Queue Data Structure
►Binary Tree Data Structure - • Binary Tree Data Struc...
►Graph Data Structure - • Graph Data Structure
►Binary Heap Data Structure - • Binary Heap Data Struc...
►Trie Data Structure - • Trie Data Structure
►Dynamic Programming Algorithms - • Dynamic Programming Al...
►Hashing Data Structures - • Hashing Data Structures
►Sorting and Searching - • Sorting and Searching
►String Algorithms - • String Algorithms
Want to land a software engineering job in the IT industry? This course - 'Visualizing Data Structures and Algorithms' is here to help. The course walks you through multiple Java algorithms, data structures problems, and their solutions with step by step visualizations, so that you are actually learning instead of blindly memorizing solutions.
The course covers in and outs of Data Structures and Algorithms in Java. Java is used as the programming language in the course. Students familiar with Javascript, Python, C#, C++, C, etc will also get to learn concepts without any difficulty. The implementation of various Algorithms and Data Structures have been demonstrated and implemented through animated slides. It covers many interview room questions on Algorithms and Data Structures. The questions and solutions are demonstrated by -
1. Animated slide. (To make visualization of algorithms faster)
2. Coding algorithm on IDE.
The course covers topics such as -
0. Algorithm Analysis
1. Arrays
2. Matrix
3. Singly Linked List
4. Doubly Linked List
5. Circular Singly Linked List
6. Stacks
7. Queues
8. Binary Tree
9. Binary Search Tree
10. Graphs
11. Priority Queues and Heaps
12. Recursion
13. Searching
14. Sorting
15. Strings
16. Trie Data Structure
17. Dynamic Programming
and many more ...
#dsa #algorithms #coding

Пікірлер: 231
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Please *Like* , *Comment* , *Share* , *Subscribe* and *Click Bell* 🔔🔔🔔 Icon for More Updates. To get *Data Structures and Algorithms* complete course for free please follow this link - kzfaq.info/sun/PL6Zs6LgrJj3tDXv8a_elC6eT_4R5gfX4d
@HussainAli-cp1yy
@HussainAli-cp1yy 3 жыл бұрын
Ĺ7lllofrlltl8lhlvlcllllollwl5nlvtrvf l
@aliqqqqarni2784
@aliqqqqarni2784 3 жыл бұрын
@@HussainAli-cp1yy ج٣ثي،
@devendrasinghrathore78
@devendrasinghrathore78 2 жыл бұрын
Main.java:74: error: non-static variable head cannot be referenced from a static context mn.display(head); ^ Main.java:74: error: method display in class Main cannot be applied to given types; mn.display(head); ^ required: no arguments found: ListNode reason: actual and formal argument lists differ in length Main.java:75: error: non-static variable head cannot be referenced from a static context ListNode reverseListHead = mn.reverse(head); ^ Main.java:76: error: method display in class Main cannot be applied to given types; mn.display(reverseListHead); ^ required: no arguments found: ListNode reason: actual and formal argument lists differ in length 4 errors
@devendrasinghrathore78
@devendrasinghrathore78 2 жыл бұрын
public class Main { private ListNode head; private static class ListNode{ private int data; private ListNode next; public ListNode(int data){ this.data = data; this.next = null; } } public void display(){ ListNode current = head; while(current != null){ System.out.print(current.data + "-->"); current = current.next; } System.out.println("null"); } /* public boolean find(ListNode head , int SearchKey){ if(head==null){ return false; } ListNode current=head; while(current!=null){ if(current.data==SearchKey){ return true; } current = current.next; } return false; } */ public ListNode reverse(ListNode head){ if(head==null){ return head; } ListNode current = head; ListNode previous = null; ListNode next = null; while(current!=null){ next = current.next; current.next = previous; previous = current; current = next; } return previous; } public static void main(String[] args) { Main mn = new Main(); mn.head = new ListNode(10); //ListNode head = new ListNode(10); ListNode Second = new ListNode(8); ListNode Third = new ListNode(5); ListNode Fourth = new ListNode(2); mn.head.next = Second; //head.next = Second; Second.next = Third; Third.next = Fourth; mn.display(); //SinglyLinkedList singlyLinkedList = new SinglyLinkedList(); //singlyLinkedList.display(head); /* if(singlyLinkedList.find(head ,1)){ System.out.println(" Search Key found"); }else{ System.out.println(" Search Key not found"); } */ mn.display(head); ListNode reverseListHead = mn.reverse(head); mn.display(reverseListHead); } }
@devendrasinghrathore78
@devendrasinghrathore78 2 жыл бұрын
sir yeh error kyon aa rahe h
@anjimacherla
@anjimacherla 2 жыл бұрын
Simply superb. I struggled to understand this concept even after seeing other animated code. Its crystal clear now. Thank You Techie. Long Live :) :)
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
Welcome !!!!
@imladyartist
@imladyartist 2 жыл бұрын
Thank you! I finally got it! Spend a lot of time trying to understand the logic. Your example is brilliant! We basically reverse every link back to the previous element!
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
Welcome !!!
@arjunbhattacharya3623
@arjunbhattacharya3623 7 жыл бұрын
Very simple demonstration and naming convention which makes it easy to understand. Thank you Dinesh!
@shubhamagarwal1434
@shubhamagarwal1434 2 жыл бұрын
Best series for DS & Algo. I am also 10 yrs java exp guy. Was looking for DS & Algo free course over KZfaq with java implementation and found this. Hats Off To You Man...Excellent Work. GOD BLESS YOU :)
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
Thanks !!!
@Channel_00124
@Channel_00124 Жыл бұрын
Thank you 😊 so much for uploading a playlist of 230 videos for DSA in Java..... It really means a lot to me...🙏🙏 Ur videos will never be replaced by any fee paid courses....dam sure!!!!!
@zuofeiyi3663
@zuofeiyi3663 6 жыл бұрын
I've been struggling this for hours. Thank you help me out. Very very good instruction!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@abdulsamad-cc7vz
@abdulsamad-cc7vz 2 жыл бұрын
don't know why your videos are so underrated, the explanation is simply amazing👌👌
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
please share it on linkedin, facebook and whatsapp etc ... it will help channel grow !!!
@Danesh41
@Danesh41 3 жыл бұрын
Everytime he said moving ahead, I drank a sip for water Jokes aside, the best explanation ever!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@sgvlogs6467
@sgvlogs6467 3 жыл бұрын
Help anyone ? My code says that non-static variable head cannot be referenced from a static context.And also how are you able to pass arguments to display which is a non parameterised method ??
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Please check the source code provided in the description of video !!!
@sgvlogs6467
@sgvlogs6467 3 жыл бұрын
@@itsdineshvaryani ok thanks my code ran successfully .But I had to made the instance variable head static and also I made a new display method which is taking ListNode head as agrument.
@jamestogher1098
@jamestogher1098 3 жыл бұрын
I'm having this same problem. I checked the source code and I still cannot get my list to reverse properly it just displays first Node which then points to null.
@JJ-zw3sm
@JJ-zw3sm 5 жыл бұрын
I saw so many videos for this algorithm, but I just could not understand, understood in single go with ur explanation
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@suryasingh6297
@suryasingh6297 7 жыл бұрын
hi dinesh nice explanation about reversing the linked in java this is the best one which i have searched on youtube
@itsdineshvaryani
@itsdineshvaryani 6 жыл бұрын
Welcome !!!
@golcuk2076
@golcuk2076 Ай бұрын
I tried to solve this problem with the knowledge that I had in previous videos and I tried for maybe 6 hours but when I saw this solution I understood that I didn't even get a bit close to a solution. Thinking about the algorithm is harder than I imagined and Thx ofc for this valuable video Dinesh.
@reshmah1497
@reshmah1497 3 жыл бұрын
This is a best way to traverse reverse. U made it understand clearly...Thanks
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Glad it helped
@snehaelizebeth6146
@snehaelizebeth6146 3 жыл бұрын
Hey, thank you so much!! Helped me a lot! Love from Kerala.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Happy to hear that!
@akshayyadav2352
@akshayyadav2352 6 жыл бұрын
very nice and helpful explanation, thanks
@philb1798
@philb1798 9 ай бұрын
Took so much time to understand this, but finally. Thanks Dinesh
@cameron8217
@cameron8217 3 жыл бұрын
Thank you for making this concept so much easier!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Welcome !!!
@nandinibagga4857
@nandinibagga4857 3 жыл бұрын
Great representation! VERY RARE TO FIND!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!! Request you to please share it with ur friends and colleagues !!!
@shreyanshjain1149
@shreyanshjain1149 2 жыл бұрын
private ListNode head change to private static ListNode head; your code will work smoothly and in display parameter write ListNode head.. nice videos sir i am Following it daily ❤️😊👏
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
thanks !!!
@VikasSingh-wp9mv
@VikasSingh-wp9mv Жыл бұрын
you use many part of ppt this is understandable any concept thanks you sir give me whole knowledge particular algorithm step by step ❣❣
@user-di5il6go6k
@user-di5il6go6k 6 жыл бұрын
You are a great teacher. Thanks!!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Welcome !!!
@akanksha188
@akanksha188 3 жыл бұрын
Yet again I'm here for explanation 😭💓💓...thank you so much to make it simple💓...
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
You're welcome 😊
@shikanderraja4956
@shikanderraja4956 Жыл бұрын
Sir, I could see the overloaded method display(ListNode node) not included in source code. Please include, it will be useful.
@NagaVenkateshgavini
@NagaVenkateshgavini 7 жыл бұрын
Thank u sir for such Wonder Ful video Series, learned a Lot, God bless you, hoping more from , please make a big.
@itsdineshvaryani
@itsdineshvaryani 5 жыл бұрын
For complete course you can enroll at my udemy course ... link in description ...
@top10thingwhichyoushouldkn37
@top10thingwhichyoushouldkn37 4 жыл бұрын
Best video i understand all things crystal n clear the presentation is so awesome
@itsdineshvaryani
@itsdineshvaryani 4 жыл бұрын
Thanks !!!!
@madhura9089
@madhura9089 7 жыл бұрын
Besides automated voice, Your explanation is spot on. Cheers! Thanks for your time and the tutorials.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Welcome !!!
@arpanaditya
@arpanaditya 3 жыл бұрын
Very simple and nice demonstration. Thank you very much for this awesome video. : )
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Welcome. I request you to like every video you watch in the series, share this playlist with ur friends and colleagues and ask them to do the same. It will help the channel grow and motivate me to add more such content. Thanks !!!
@alexwilson8269
@alexwilson8269 5 жыл бұрын
Thank you for doing something my professor failed to do :)
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Great !!! Thanks !!!
@debanjanasantra6724
@debanjanasantra6724 Жыл бұрын
Hi Dinesh, Have been following your content and I really appreciate the call stacks that you show whenever there is a recursive approach. I would be glad if you can explain the recursive approach to this problem using the call stack.
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
Will try to add once i start again posting videos !!!
@palashkhatri7820
@palashkhatri7820 4 жыл бұрын
Beautiful simple explanation thank a lot
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
You are welcome
@mkeebs3623
@mkeebs3623 2 жыл бұрын
explanations another level ty :)
@shubhamsingh-lf6zy
@shubhamsingh-lf6zy 3 жыл бұрын
Sir after first stage of while execution when first node break it's link with second why it does not goes into garbage.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Bcoz we have reference holding him via listnodes - current, temp and previous. Those temporary listnode are created to hold listnodes till operation is successful!!!
@manmeetkaur80
@manmeetkaur80 3 жыл бұрын
It was brilliant i watched alot of videos and finally got yours. Can you do full data structure in java
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
I have added a playlist covering as much as topics I can - kzfaq.info/sun/PL6Zs6LgrJj3tDXv8a_elC6eT_4R5gfX4d
@ijanijigar
@ijanijigar 6 жыл бұрын
Chha gaye guru !! Nice way of explaining things.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@rohankumarshah5679
@rohankumarshah5679 3 жыл бұрын
Damn, your animations are super cool which makes learning truly understandably!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@shivangisrivastava1158
@shivangisrivastava1158 3 жыл бұрын
what a perfect skill to teach , i am so amazed!!! wow 🔥👌
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thank you! Cheers!
@abhinavkapur9729
@abhinavkapur9729 5 жыл бұрын
Dinesh, Very Good explanation. Can you also post a video for reversing the list recursively.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Sure !!! Will add it to my pending video list !!!
@kusumareddy7904
@kusumareddy7904 2 жыл бұрын
Thank you very much sir for your wonderful videos, it helped me a lot
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
Welcome !!!
@AbhishekKumar-zg7if
@AbhishekKumar-zg7if 2 жыл бұрын
Thank you,Sir. You are a saviour.
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
welcome !!!
@ramdeoyadav5700
@ramdeoyadav5700 4 жыл бұрын
Presentation and explanation is awesome
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks a lot 😊
@sermilion_audio
@sermilion_audio 7 жыл бұрын
Great explanation.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@dineshnembang9657
@dineshnembang9657 3 жыл бұрын
thanks for your good explanation in a simple way sir, lots of love from nepal
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!! Please share it with ur friends and colleagues too !!!
@vishalrane1439
@vishalrane1439 2 жыл бұрын
Very nice explaination sir 👍🏻 Thank you
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
Welcome !!!
@anujdate3346
@anujdate3346 4 жыл бұрын
great representation great explanation keep it up
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Glad you liked it
@sushmithahs8037
@sushmithahs8037 Жыл бұрын
thank you so much sir, DSA playlist helping me a lot😊
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
Welcome
@madhura9089
@madhura9089 7 жыл бұрын
Btw, Please make video's on Trees, Queues and other data structures.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
@Vikas Gupta i have unpublished all my best seller courses from udemy and made it free on youtube. Check video description to get playlist having all DSA videos.
@shubhamsingh-lf6zy
@shubhamsingh-lf6zy 3 жыл бұрын
Hello sir your teaching style is really good and people who are from non CS field can access it.
@shubhamsingh-lf6zy
@shubhamsingh-lf6zy 3 жыл бұрын
Sir please tell me which book and which references I should follow to get complete knowledge of data structures.
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
@@shubhamsingh-lf6zy thanks a lot !!!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
@@shubhamsingh-lf6zy Algorithms by Robert Sedjewick and Data Structures and Algorithms by Narasimha Karumanchi
@meowmr9
@meowmr9 Жыл бұрын
what the hell lol!!! how can someone be so damn good at explaining stuff. Thanks so much! :)
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
Welcome
@ENGCS_BhajanHP
@ENGCS_BhajanHP Жыл бұрын
Awesome explaination 🤩......
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
Glad you liked it!
@Devil-dn2ew
@Devil-dn2ew 3 жыл бұрын
sir why this display method contains parameter(arguments) now, as in previous lectures it is not!!!! sir, when to use and when not to?????
@shaikhusseni1965
@shaikhusseni1965 2 күн бұрын
Nice Explanation sir
@a.kgaming2360
@a.kgaming2360 3 ай бұрын
sir i have a question to ask i have been following your playlist from the start and practicing along the way in displaying the linked list video you used a function without any parameter but in this video you were displaying your linked list by passing in an argument which is the head of the listnode im doing all the steps but its not displaying the reverse linked list correctly can you guide me on what you did there by passing the parameter even though we could just display the linked list without any sort of argument like you did in your last displaying elements video.
@a.kgaming2360
@a.kgaming2360 3 ай бұрын
now im answering my own question cuz i wasnt looking clearly at first we did that head step just because this reverse program returns one node by making the last node as head and then that node acts as a parameter to display the reversed linked list (i get it )
@abhinavharsh5037
@abhinavharsh5037 2 жыл бұрын
Actually I created the linked list from your video then when using the reverse code it is not working as i guess you have made some changes in main method while calling the reverse method
@rahultiwary1215
@rahultiwary1215 7 жыл бұрын
nice explanation ..great
@itsdineshvaryani
@itsdineshvaryani 6 жыл бұрын
Welcome !!!
@VikasSingh-wp9mv
@VikasSingh-wp9mv Жыл бұрын
your tutorial very best
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
Welcome
@arshassija
@arshassija 3 жыл бұрын
Great explanation 😍
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@lissettesoto3974
@lissettesoto3974 2 жыл бұрын
very good demo thank you
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
welcome
@janiszhang5171
@janiszhang5171 Жыл бұрын
I got you Bro!! Thanks for sharing your knowledge !!!
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
Welcome
@abhishekranjan1094
@abhishekranjan1094 3 жыл бұрын
sir how to remember all the codes and algorithms.. please give your opinion about this... Please sir 🙏
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Remember ??? .... Its all rigorous practice , practice and practice questions ... solve leetcode questions daily ...
@hungpn.2314
@hungpn.2314 10 ай бұрын
YOU ARE BEST !!!!
@kunalkheeva
@kunalkheeva 2 жыл бұрын
thank god i found something good !!
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
Welcome !!!
@harshadgandhale5372
@harshadgandhale5372 2 жыл бұрын
Excellent work sir
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
thanks !!!
@govindmishra910
@govindmishra910 7 жыл бұрын
Ammazzzziiiingggggggg work bro......thnx a ton
@itsdineshvaryani
@itsdineshvaryani 6 жыл бұрын
Thanks !!!
@helperfunc3718
@helperfunc3718 4 жыл бұрын
nice explanation !
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Glad you liked it!
@RaviKumar-cw1vl
@RaviKumar-cw1vl 6 жыл бұрын
Thankyou so much
@itsdineshvaryani
@itsdineshvaryani 6 жыл бұрын
+Ravi Kumar Welcome !!! Do watch my other tutorials as well !!! Thanks
@surbhibhardwaj6750
@surbhibhardwaj6750 2 жыл бұрын
Thank you sir!
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
Welcome !!!
@bruiciedoocie3721
@bruiciedoocie3721 2 жыл бұрын
Sir actually the head still points to the first node even after reversing it.. is it normal?? because when i apply the length() method it shows the length to be 1 if i reverse the list. need help sir!
@learntechhi3324
@learntechhi3324 5 ай бұрын
Head=prev
@naibhavik1449
@naibhavik1449 Жыл бұрын
Thank You Sir❤!
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
You are welcome !!!
@smileplease6151
@smileplease6151 4 жыл бұрын
Thanks a lot sir🙏🙏🙏
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Most welcome
@bonbonvrock84
@bonbonvrock84 6 жыл бұрын
I don't get why ListNode next=null. I mean in the diagram of the source list you can clearly see it representing the second node that contains 8. So I don't get why you can set it to null in the beginning of the algorithm.
@satishrock9621
@satishrock9621 5 жыл бұрын
That is not the next node in the list. It's actually a placeholder to store next node of current node in each iteration. Because we change pointers. so need to track. Even previous also a placeholder.
@satishrock9621
@satishrock9621 5 жыл бұрын
Really Nice Bro
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@snehan3341
@snehan3341 3 жыл бұрын
thank you sir!!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Welcome !!!!
@ombohare6485
@ombohare6485 3 жыл бұрын
it helped a lot
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@mayankmoolchandani7976
@mayankmoolchandani7976 6 жыл бұрын
thankYousir
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Welcome !!!
@cocoon2024
@cocoon2024 8 жыл бұрын
thank you very much
@itsdineshvaryani
@itsdineshvaryani 8 жыл бұрын
+bunny tb welcome !!!
@Semmukil
@Semmukil 6 жыл бұрын
good video.Its helped me lot...cheers
@sakthivelj1618
@sakthivelj1618 7 жыл бұрын
You are good sir
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@rryann088
@rryann088 Жыл бұрын
helped thanks
@itsdineshvaryani
@itsdineshvaryani Жыл бұрын
You're welcome!
@rajeevranjan4013
@rajeevranjan4013 6 жыл бұрын
thanks
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Welcome !!!
@tarangkataria3979
@tarangkataria3979 Жыл бұрын
i didnt get it from 9:35 (demonstration part)
@Danesh41
@Danesh41 4 жыл бұрын
You are awesome sir
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@archittoshniwal8085
@archittoshniwal8085 2 жыл бұрын
Sir can you Please make a video on reverse linked list in group of K
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
ok will add it to pending list !!!
@buddaiahvagairajanardhanra5318
@buddaiahvagairajanardhanra5318 2 жыл бұрын
Sir..Can u provide source code for this code... Seperately. In github link of urs... It's all merged. So please provide me a source code for this reverse a singly Linked List Code. Thanks
@varsha_bhat
@varsha_bhat 2 жыл бұрын
I did not get how are we displaying the list, because. display is taking head, but in source code, we just have a display method without any parameters. Can someone help?
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
head is instance variable !!!
@S__DhruvTrehan
@S__DhruvTrehan 2 жыл бұрын
Sir can you make a video on this question :-- Reverse a Linked List in groups of given size.
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
sure
@Anilkumar-ec8sj
@Anilkumar-ec8sj 7 жыл бұрын
Thank you for this very well explained. You know any youtube channel to learn android like yours?
@Vishal-ng2xb
@Vishal-ng2xb 7 жыл бұрын
slidenerd..its the best
@itsdineshvaryani
@itsdineshvaryani 6 жыл бұрын
Welcome !!!
@noobCoder26
@noobCoder26 4 жыл бұрын
thank u sir
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
All the best
@joyateechattopadhyay9510
@joyateechattopadhyay9510 3 жыл бұрын
awesome
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@kinneravijay617
@kinneravijay617 3 жыл бұрын
But sir i am facing an error like can't make a static reference to non static field head
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Check source code provided in the description of video...
@guangyitan6073
@guangyitan6073 7 жыл бұрын
good!
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Thanks !!!
@ravishankarkumar106
@ravishankarkumar106 4 жыл бұрын
good videos
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Glad you like them!
@Abhimanyukumar-me3cf
@Abhimanyukumar-me3cf 6 жыл бұрын
How to get complete source code..
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Its in description of video !!!
@versatileshankar3010
@versatileshankar3010 8 жыл бұрын
Is it possible to reverse the linked list without using reverse function.
@sajanlamsal
@sajanlamsal 6 жыл бұрын
use recursion
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
you need to write logic to reverse the singly linked list in one named method via recursion or without recursion
@versatileshankar3010
@versatileshankar3010 2 жыл бұрын
@@itsdineshvaryani Thanks for the reply but it is too late.
@user-ju1qd9ek2m
@user-ju1qd9ek2m 6 жыл бұрын
i like this video
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
thanks !!!
@jagadeshreddyvankala6020
@jagadeshreddyvankala6020 2 жыл бұрын
here display method void it doesnot take any parameters till your last videos can you pls send the code to me.i have little bit confusion in the demonstration of this
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
The source code link is in description of video
@jagadeshreddyvankala6020
@jagadeshreddyvankala6020 Жыл бұрын
@@itsdineshvaryani but in your source also your code does not have parameters in display method
@jagadeshreddyvankala6020
@jagadeshreddyvankala6020 Жыл бұрын
it was displaying like this : SinglyLinkedList$ListNode@3fee733d
@princesssingcol629
@princesssingcol629 3 жыл бұрын
I can't find the complete source code in that link, denish can you help? ehhehe
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
The source code link has been added to description Or you can find at - github.com/dinesh-varyani/ds-algos
@abhishekmatta6539
@abhishekmatta6539 7 жыл бұрын
helping
@nabilelassaad6086
@nabilelassaad6086 3 жыл бұрын
what is the time complexity
@nabilelassaad6086
@nabilelassaad6086 3 жыл бұрын
?
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
O(n) ...
@nabilelassaad6086
@nabilelassaad6086 3 жыл бұрын
Dinesh Varyani is this the best approach ?
@RAMAKRISHNARV
@RAMAKRISHNARV 5 жыл бұрын
You have not shown the ListNode class , that could be some private class inside the main class..Can you show that as well.
@itsdineshvaryani
@itsdineshvaryani 5 жыл бұрын
its in previous tutorials ... its continued keeping that stuff in mind ...
@RAMAKRISHNARV
@RAMAKRISHNARV 5 жыл бұрын
@@itsdineshvaryani If you dont mind can i have the link of that tutorial?
@RAMAKRISHNARV
@RAMAKRISHNARV 5 жыл бұрын
@@itsdineshvaryani private class ListNode{ private T data; private ListNode next; } Is this..
@itsdineshvaryani
@itsdineshvaryani 5 жыл бұрын
@@RAMAKRISHNARV u can browse my channel ... there u will get playlist for data structures and algorithms or Linked List
@itsdineshvaryani
@itsdineshvaryani 5 жыл бұрын
@@RAMAKRISHNARV yes with a constructor having data part ....
@harshadgandhale5372
@harshadgandhale5372 2 жыл бұрын
Dinesh Sir capgemini ,tcs,accenture inke coding rounds questions kaise solve karte hey ...make videos on that it will be helpful for us
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
am covering frequently asked coding interview questions only !!!
@harshadgandhale5372
@harshadgandhale5372 2 жыл бұрын
@@itsdineshvaryani ok sir
@harshadgandhale5372
@harshadgandhale5372 2 жыл бұрын
Sir where is the coding questions😊
@harshadgandhale5372
@harshadgandhale5372 2 жыл бұрын
Sir please reply
@itsdineshvaryani
@itsdineshvaryani 2 жыл бұрын
its part of DSA playlist only ... check my channel home page !!!
@adarshkv4616
@adarshkv4616 3 жыл бұрын
Wow! What a beautiful explanation
@itsdineshvaryani
@itsdineshvaryani 3 жыл бұрын
Glad you liked it
How to search an element in a Singly Linked List in Java ?
10:37
Dinesh Varyani
Рет қаралды 47 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 50 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 10 МЛН
Why Floyd's Cycle Detection algorithm works?
19:30
Dinesh Varyani
Рет қаралды 20 М.
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 291 М.
LinkedList vs ArrayList in Java Tutorial - Which Should You Use?
11:43
Coding with John
Рет қаралды 582 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 633 М.
Linked lists in 4 minutes
4:22
Michael Sambol
Рет қаралды 66 М.
LeetCode - Reverse Linked List Solution
7:02
Nick White
Рет қаралды 122 М.
Learn Linked Lists in 13 minutes 🔗
13:24
Bro Code
Рет қаралды 276 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 50 МЛН