amazing explanation thank you I was starting at head and getting it wrong now I understand why we need dummy in traversal to accomplish task
@minnikeswarrao61852 жыл бұрын
One small improvisation can be done... To change the head and tail pointers when the node to be deleted is one of them... However you are just awesome mann🤩
@ArunaSrivastava-xb5eq Жыл бұрын
You are the best, lots of love from seattle
@nikoo28 Жыл бұрын
Thank you so much. I have been to Seattle too :D
@shivraj940 Жыл бұрын
Implement queue using Linked List : Its very simple . we don't have to think much on this. 4 operation of Queue Data structure : FIFO 1. Enqueue() -> Simply insert the element in tail part -> TC : O(1) 2. Dequeue() -> Simply move head ie) head = head.next -> TC : O(1) 3. front() -> head.val -> TC:O(1) 4. isEmpty() -> return head == null -> TC:O(1)
@CodeOs52 жыл бұрын
sir can you comment the name of book that u mentioned in one of your video for ds algo
@nikoo282 жыл бұрын
The book is always available in every video description :)
@ymhuang6512 жыл бұрын
Keep Going!🤩
@nikoo282 жыл бұрын
🚀
@jayprakashjaiswal8220 Жыл бұрын
nice explaination bhaiya
@honey-xr5kp8 ай бұрын
what is that x: -1 when you create the dummy head node? I've never seen that before.
@atharv_rege58697 ай бұрын
that x is the variable or parameter in which -1 is stored
@atharv_rege58697 ай бұрын
it is just the data part of the dummy node because we dont actually need the data of the dummy node
@tanishbagal55213 ай бұрын
nice explaination
@subee12811 ай бұрын
Thanks
@Upendrachauha2310 ай бұрын
What about this node [5,5,5,5,5]🤔🤔
@nikoo289 ай бұрын
what is the value of 'val'?
@preetnandeshwar53319 ай бұрын
@@nikoo28 val = 5
@atharv_rege58697 ай бұрын
@@nikoo28 bhaiya what if the the node which is updated itself contains the val because we are actuallly checking the data of the next node but if the present node contains the data then it will not be removed na?? like if the ll is 1-> 2 -> 3 -> 3 -> 4 and the val is 3
@zerkinanastya4410 Жыл бұрын
Thank you dearly for the video! It helps a lot! But could you please explain the (x:-1) notation in new ListNode(x:-1); and how it will look like in js? Bc I can create a dummy node in js with this notation: let dummy = new ListNode(); or I can pass 0 or -1 in ListNode(-1) or ListNode(0) and it still works. Why should we write -1. I am new to programming, so if only you could explain…🙏I would be much grateful!