yuval
yuval
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
i changed it abit and it doesnt work in a case that its in the middle or after
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
public static bool HasCircle(Node<int> lst)
{
Node<int> curr = lst;
if(curr == null)
return false;
bool flag = false;
Node<int> temp = lst;
while(curr != null && !flag)
{
while (temp != null && !flag)
{
if (temp.GetNext() == curr)
flag = true;
temp = temp.GetNext();
}
curr = curr.GetNext();
temp = curr;
}
return flag;
}
public static bool HasCircle(Node<int> lst)
{
Node<int> curr = lst;
if(curr == null)
return false;
bool flag = false;
Node<int> temp = lst;
while(curr != null && !flag)
{
while (temp != null && !flag)
{
if (temp.GetNext() == curr)
flag = true;
temp = temp.GetNext();
}
curr = curr.GetNext();
temp = curr;
}
return flag;
}
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
ok ill try
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
does it affect the code?
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
yeah i think it is
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
does it matter?
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
can it pointto itself?
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
maybe i just overcomplicated the code but idk how to put what i think into the code
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
so where do i start to check that there is a circled linked list inside a linked list?
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
ok i understand now
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
english is not my first language so my translation is poor
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
yes this is what i meant
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
sry mb
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
ok
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
so a node?
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
oh
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
oh really
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
i have trouble with writing the code itself bc lists is pretty new to me
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
yes
53 replies
CC#
Created by yuval on 1/18/2024 in #help
Need help with question about lists
ty for helping
53 replies