2021年4月10日星期六

Find the math solution to this circular linked list problem

During an interview I was asking the math solution for this circular linked list problem, but I couldn't answer it.

The image contains a circular linked list and circular length is n and straight line length is m, and there are two students a and b, a takes one step forward each time whereas b takes two steps forward each time, so when they meet each other how many steps student a had forwarded? please provide the math equation to calculate the steps of student a, I suck at math so failed this interview.

please see here

https://stackoverflow.com/questions/67015484/find-the-math-solution-to-this-circular-linked-list-problem April 09, 2021 at 01:22PM

没有评论:

发表评论