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 - kzbin.info/aero/PL6Zs6LgrJj3tDXv8a_elC6eT_4R5gfX4d
@jaspalsingh-mv5xh3 жыл бұрын
👍
@shubhamagarwal14342 жыл бұрын
Best series for DS & Algo. I am also 10 yrs java exp guy. Was looking for DS & Algo free course over KZbin with java implementation and found this. Hats Off To You Man...Excellent Work. GOD BLESS YOU :)
@itsdineshvaryani2 жыл бұрын
Thanks !!!
@anantkashyap20873 жыл бұрын
sir your channel is a boon for the data structure learners ,with java as their programming language .I wonder why this channel is not among the most viewed channels on youTube ...because no one makes such a value adding quality content .. Your work is amazing sir ...the day is not soo far when you will get lakhs or millions of views on your channer ...Thankyou so much sir, continue making videos like this sir ..we love it
@itsdineshvaryani3 жыл бұрын
Thanks for such a wonderful comment. I request you to like each video you watch on my channel. Also, please share the course with ur friends and colleagues on whatsapp, FB, Linkedin etc. It will help the channel grow and allow me to add more such content.
@anantkashyap20873 жыл бұрын
Sir I have watched almost 40-50 video including trees,graph linkeslist,heap and priority queue ...and liked almost every video which I saw ....and had shared it on whatsapp and Facebook ...will share it soon on Linkedin sir ......your content is worth sharing and viewing ♥️
@itsdineshvaryani3 жыл бұрын
@@anantkashyap2087 thank you so much !!!
@sanchitjain97453 жыл бұрын
good content for the last minute preparation....loved it
@itsdineshvaryani3 жыл бұрын
Thanks !!!
@soumyadipmajumder902 Жыл бұрын
Really enjoying your course, Thank you sir for the course
@itsdineshvaryani Жыл бұрын
You are very welcome
@Rahulkumar-dm4zu2 жыл бұрын
Hi @Dinesh Varyani, This code will not work if SinglyLinkedList has only one node say head as you are not nullifying the reference of head to null, instead you are just returning the head. In this case SinglyLinkedList will always have the one node i.e. head. So no deletion will take place. Please correct me if I am wrong. Thanks,
True. Without the head = null, the LL will never be able to delete the final node.
@omeruluyagmur3 жыл бұрын
I didn't understand how the last node was deleted, because at the end of the code blocks it only returns current node but current node does not contains entire LinkedList.
@itsdineshvaryani3 жыл бұрын
you can return head ... currently algo returns deleted node !!!
@_PRACHIGHARDE3 жыл бұрын
We can directly do like--> if(head==null || head.next==null) { return null; } else { while(currNode.next.next!=null) { currNode=currNode.next; } currNode.next=null; return currNode; }
@itsdineshvaryani3 жыл бұрын
check for null pointer exception ... if it works ... it could be one way !!!
@_PRACHIGHARDE3 жыл бұрын
@@itsdineshvaryani yes it works..
@shashanksheelwant52732 жыл бұрын
you have to return deleted node not the current node ,for that case@1655_PRACHI GHARDE your code won't work.
@prakharrana83843 жыл бұрын
thanks sir
@dagaprerna3 жыл бұрын
When you return head when head.next= null, why are you not doing head =null?
@itsdineshvaryani3 жыл бұрын
hmm could be done ... depending on scenario u trying to achieve !!!
@leoking23863 жыл бұрын
If we only have a head element then it is the first and last element. So shouldn't we delete that element and return the head as null?
@itsdineshvaryani3 жыл бұрын
we shd delete that node as well !!!
@jaspalsingh-mv5xh3 жыл бұрын
Nice
@itsdineshvaryani3 жыл бұрын
Thanks
@jaspalsingh-mv5xh3 жыл бұрын
Nuce
@itsdineshvaryani3 жыл бұрын
Thanks. 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 !!!
@modinglymods4085 Жыл бұрын
❤
@omeruluyagmur3 жыл бұрын
This code can also run but I cannot understand how it works. public void deleteLast(){ if (head==null ||head.next==null) return; Node current=head; Node previous=null; while (current.next!=null){ previous=current; current=current.next; } previous.next=null; }
@itsdineshvaryani3 жыл бұрын
previous reference is needed to remove current node ... after while loop ends current is at last node and previous is second last ... you can set previous.next to null to remove current node.