שאלה למוחות הפורום,

gil levi

New member
טעות?

זה לא אומר להיות "A הארוכה יותר" ו"כל עוד " a.next<>b.next נקדם אותם, אם "a.next==b.next אז c יקבל את a.next" ? אם למשל :
A is "a-->b-->c-->d-->e-->f-->g" B is "l-->m-->e-->f-->g" then a will point to "c", b will point to "l". while a.next != b.next we set a to be a.next and b to be b.next (this will happen for 1. a="c", b="l" 2. a="d", b="m"). if a.next=b.next then we have found the first link that is part of A and part of B.​
----------------------------------------------------------------------- בהחלט פורום נחמד. אתה מוזמן להישאר
 

Blue Beetle

New member
צודק שכחתי

צריך (אחרי הספירה) לקדם אותם עד שהם שווים ואז לקבוע את c.
 
למעלה