Why this isn’t working?
Question is To find size of Circular LL?
Why this isn't working?
hello @cbcao263

your temp is already equal to head, so ur while loop will never run.
hence u will always get 0 in ur answer.
while(temp->next!=head)
I did this and it is always returning the size as 5.
yeah now this looks correct
Sir It is always returning ans as 5
Sir How you solve all these doubts as you will recieve a lot of Questions from other platforms too.
Do You debug all the codes, Isn’t it very difficult
Or
You have done a lot of practice and it’s very easy for you now.
yeah i practice a lot.
initialise ur sz with 1.
From which platform Sir
I just entered in Second Year and discussed with my senior who recently got Interned in Arcesium.
He told me to just do DSA and LEETCODE for that.
Nothing Else he has done
When size is given initial value as 1
The Output is always 6
yeah leetcode is good plaform .
currently i m practicing on leetcode only.
I think there might be problem in creation of Circular LL.
I will check that again too.
Okayy Thanks Sir
Leetcode + CF nd CC Contests
Will that be sufficient?
yeah … …
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.