Your videos are of great help and the language you use is so simple and understandable.Thanks.
@farazromani7 жыл бұрын
These are great series of videos! I'm glad I came across them. One suggestion -- at the end of the videos, could you also discuss the space and time complexity for your algorithms? Thanks and keep 'em coming!
@vivekanandkhyade7 жыл бұрын
yes sure...
@anweshvalleshetti34996 жыл бұрын
It throws nullpointer exception in the even case, because p is already null and your trying to access p.next()
@avinashkhetri95755 жыл бұрын
yeah, just reverse the order of the if conditions though
@Ashish.Shukla95 жыл бұрын
Yeah just put if(!p.null && p.next=null) it will work
@ezrahn5 жыл бұрын
Just check for the even condition first, and then the odd.
@sergiojimenez34457 жыл бұрын
I came here looking for cooper and I found gold
@SnehasishGhoshSg6 жыл бұрын
Why were you looking for Cooper ? what would cooper Fix ?
@AbhishekKumar-qr5ql5 жыл бұрын
kuch bhi matlub
@siddhartharaja94134 жыл бұрын
@@AbhishekKumar-qr5ql it's good and logical
@saketkumar73354 жыл бұрын
you mean copper??
@ProgrammingTutorials1M5 жыл бұрын
We can also use stack to determine whether it's a palindrome or not.
@TechTanka7 жыл бұрын
When p is null, p->next will throw null pointer at this line on even length check :- if(p ->next == NULL)
@jamesqiu67157 жыл бұрын
exactly! should add a bound check
@seekngeek7 жыл бұрын
Check if(p == NULL) first and then check if(p->next == NULL). Just swap the checks. That should solve it.
@debanjankuri52744 жыл бұрын
@@seekngeek Thank you so much
@VanTran-zf7mg4 жыл бұрын
Would you please make an example of copy constructor in the Linked List in C++? Thanks
@pankushmahajan45986 жыл бұрын
Mr. Vivekananda ji , try to make videos on hashing
@ProgrammingArena6 жыл бұрын
Your program will "Crash" in the second scenario (for Even Number of Elements of Linked List) --> At the last Iteration when "P" becomes a NULL, and your try to access the data from P->Next --> Result in Crash as there is no any address of P. You need to modify the if statement as follows: Option1: if(p->next == NULL) -- Modify to --> if(p && p->next == NULL) Option2: swap the positions of both the "if" statements and the second if statement would be an "else if" rather than just "if". Thanks!
@soumilyade10576 жыл бұрын
perhaps, the conditions can be put in an if..else if statements.. if(p==NULL) //p is not null in the first case. so this condition is skipped// ..... else if(p->next==NULL)// valid for the first case; if the if part executes, the else if part is skipped and the execution continues unhindered!!??// I did not get your first suggestion though, could you please clarify it? what I understood is that if(p!=NULL && p->next==NULL) can be put as the first if condition.
@ProgrammingArena6 жыл бұрын
yes, exactly you understood my first condition correctly. The first condiition if(p->next == NULL) will crash the whole program if in case the pointer "p" goes NULL. Hence, to avoid such instances, we must check if p is not NULL. just to clarify you: if (p) and if (p != NULL) both are same !
@soumilyade10576 жыл бұрын
yes !! I understand that now xD Thanks...
@rohankrishna1564 жыл бұрын
It's a Null pointer exception for this test case: [1,0,1] . The when we have to assign secondStart = q.next.next, it will point to Null
@koeber997 жыл бұрын
Or you could add all the elements to stack and then check half the LinkedList: time is O(n).... but space is O(n)
@vivekanandkhyade7 жыл бұрын
Yes koeber99 , that trick would work.
@satvikkhare18442 жыл бұрын
This was asked in my Nvidia experienced software interview. Please make more videos.
@SK-qn5ry2 жыл бұрын
Oh nvidia, great
@rishabhsahu52574 жыл бұрын
Amazing !!Effort for us .Huge respect bro
@cemyasar48585 жыл бұрын
The point is finding middle node. The solution is creating a race condition. One pointer's velocity must be two times bigger than other pointer's velocity. When faster pointer reaches the end, other pointer will be in the middle. I prefer recursive way. I will find the middle by recursively then start comparing from middle nodes(even or odd problem also here) then by returning next node to upper recursive iteration and comparing prev node and returned next node and so on..
@shailbenq6 жыл бұрын
The first IF condition in while loop "if(p.next == null)" should be "if(p != null && p.next == null)"
@talhacoder50843 жыл бұрын
dude this one condition T_T Thank you :)
@r3fl3xplays366 жыл бұрын
sir could you please make a video on XOR linked list , SKIP list , UNROLLED list..
@informative_idiot-x6e6 жыл бұрын
Thanks for the wonderful video.... Please take a look into the first "if" condition, as many mentioned in the comments.... Thanks!!!! :)
@HarshKumar-nh6be4 жыл бұрын
Your videos are very great can you please upload videos on dynamic programming problems like gold mining, tiling problem
@palagatideepthireddy36596 жыл бұрын
in even linked list if p is nul lthe statement p->next will give segmentation fault because pointer pointing to non existing locaton
@uzairkhurshid30367 жыл бұрын
seriously dude this is really good .appreciate it
@mdanishossain0262 жыл бұрын
sir , can you make please ad_hoc algorithm playlist
@PrashantNigam5 жыл бұрын
Can you please make a video on Single Pair All shortest paths problem? Given a source and a destination find all the shortest between them (there can be more than 1 path with the same length, hence all the shortest paths).
@rajatbais63885 жыл бұрын
SIR YOUR WAY OF TEACHING IS GOOD, But It will be a good practice if you explain the approach first means what actually you are going to tell for this or any problem then go for the algorithm or dry run of the code. Once we know the approach we can understand the video very easily and quickly.
@parthsinghparihar19044 жыл бұрын
Why can't we reverse that linked list and compare with the original value at each node , If any of the respective nodes aren't equal to both , then return 0 ?
@shubhammalik94184 жыл бұрын
I don't see the full working code on the given link. There are only few codes, not all. Can you please share the full code for this problem?
@alifruslan27284 жыл бұрын
Okay, I wanna add, as we are reversing after splitting up, can't we just reverse the linkedlist at the very beginning and check if both are same? This doesn't require splitting the list. Thanks in advance
@dankyt92494 жыл бұрын
We can do it but it is not feasible as it needs traversing whole list and then comparing it. In this we are just doing half comparisons and also running loop for half. So for very long linked list it will reduce to half time complexity.
@AddieInGermany7 жыл бұрын
Sir please discuss how to recursion and when and where ? Especially with linked list, tree etc
@devotion_surya37414 жыл бұрын
Sir, what an explanation, amazing💥
@chetanshrivastava37623 жыл бұрын
Nice video.God bless you..
@rohan57136 жыл бұрын
but we also use the reverse of linked list approach also while(i
@nitinjangra51645 жыл бұрын
we cannot back traverse linked list
@bharathik64794 жыл бұрын
Awesome Explanation. I am new to algorithm yet understood this very clearly. Thank you so much , You are saving my grades and career. One small request , Can you please add the gib hub link in the description .
@kalpatarupodder7086 жыл бұрын
sir, we can also do it like taking two pointers at two end and traversing in the opposite direction and matching the elements,if all elements matches then its palindrom
@SOURABHGOLCHHABCE6 жыл бұрын
bro it is singly linked list and in the case of singly linked list there is no means of going in the backward direction as it is not the doubly linked list thanks !!!
@shwetayadav32884 жыл бұрын
Very clear explanation.
@viewgood4 жыл бұрын
Thank you a good explanation, your voice is the same as the tutor in the KudVenkat channel, are you the same ?? just curious !
@adi_sekar4 жыл бұрын
No they are different
@ganeshjaggineni40972 жыл бұрын
NICE SUPER EXCELLENT MOTIVATED
@shloch20075 жыл бұрын
very good with explanations..........always checkout this channel, dope
@prashantshukla72037 жыл бұрын
you are doing great job sir!!
@GeekXpert5 жыл бұрын
why cant we just reverse the entire linked list and then check?
@nitinjangra51645 жыл бұрын
if you are creating a new reversed linked list that would increase the space complexity...acc to me what we can do is traverse linklst and store in a number then compare accordingly using modulo operator O(1)---space and O(n)---time
@parambharti70955 жыл бұрын
Very nice explanation.
@ArpitDhamija5 жыл бұрын
you can rather do it by recursion, it can be more simple and small.....
@ArpitDhamija4 жыл бұрын
@Monkey D. Luffy sure , I will make it , I have my competitive programming channel , my exams are going on, after that , I will consistently upload videos there
@ShivaniSingh-mq4pv3 жыл бұрын
Amazing vedio
@16avnisharma7 жыл бұрын
very useful videos.. keep posting sir
@harshtulsyan98946 жыл бұрын
Hello sir....i need a video to find theLength of longest palindrome list in a linked list using O(1) extra space.
@mohammedsadiq15674 жыл бұрын
Why not reverse the list first?? And then compare?
@priyanshu40163 жыл бұрын
public static void main(String[] args) { System.out.println("entier string to check palindrome :"); char[] input = new Scanner(System.in).next().toCharArray(); int forword=0; int backword=input.length-1; int mid=input.length/2; for(int i =0;i
@SK-qn5ry2 жыл бұрын
I think you write for array, But question is singly linked list Though iam not sure whether yoy written for singly linked list or not
@deepakborah83357 жыл бұрын
Really your videos are excellent
@sallyzhangt6 жыл бұрын
Thank you. This is very clear.
@brijyotchawla32475 жыл бұрын
What would be space complexity of this solution ?
@gunslingerarthur58655 жыл бұрын
I dont think space complexity will be an issue here as all you require is just three extra pointers p,q and start
@ridimamittal40644 жыл бұрын
amazing explanation , thank you so much :)
@srafayal2 жыл бұрын
big an sir love you from odisha❤❤❤❤
@hibritto2 жыл бұрын
Genius.
@suriyapriyajayavel11767 жыл бұрын
hello sir....I need program for reverse a linked list from position n to m... n=2 and m=5 LL 1->2->3->4->5->6 output becomes 1 5 4 3 2 6
@gurpeetsingh91526 жыл бұрын
sir can u provide a link to a source code...i am unable to find it
@pkl5207 жыл бұрын
explain very clear! Big thanks!
@VishalYadav-ss4qv4 жыл бұрын
Excellent 🙏🙏
@divyagupta51954 жыл бұрын
how will this work for a b c c b ?
@sushmitanigam49797 жыл бұрын
awesome explanation. Thanx a lot sir.
@vivekanandkhyade7 жыл бұрын
Thanks Sushmita..!
@jeezradz4 жыл бұрын
great video!!!
@ZeeshanKhan-mo9mu7 жыл бұрын
plzz give me a function that check linked list is sorted or not? plzz give me code