KleinRiese
✅ How to learn data structures and algorithms?
I am trying to learn data structures and algorithms. I use neetcode.io(only free version) and Leetcode. But I don’t really have direction besides the roadmap on neetcode.io.
Additionally I have a lot of questions:
How many questions should I do before going to the next topic?
How should I learn the topics(try to solve a problem first and then learning from the solutions, or straight up learning the topic from e.g. a YouTube video)?
Are there other great recourses?
I would be thankful for any advice!!!
(I am really sorry for my bad English. I am not a native speaker speaker)
9 replies
✅ Problem with a Recursion Function
I am currently programming a Snake-Clone and want to count the Parts(length of the tail) of the snake. Each part has a reference to the next part, called "next tail part". Is the recursion-function the problem, or something else?
I am Printing the Result, by calling the function in the Debug.Log function : Console.WriteLine(DebugSnakeParts());
Function:
private int DebugSnakeParts()
{
if(nextTailPart == null)
{
return 1;
}else
{
return DebugSnakeParts() + 1;
}
3 replies