Horje
merge point of two list Code Example
merge point of two list
int FindMergeNode(Node headA, Node headB) {
  Node currentA = headA;
  Node currentB = headB;

  // Do till the two nodes are the same
  while (currentA != currentB) {
    // If you reached the end of one list start at the beginning of the other
    // one currentA
    if (currentA.next == null) {
      currentA = headA;
    } else {
      currentA = currentA.next;
    }
    // currentB
    if (currentB.next == null) {
      currentB = headB;
    } else {
      currentB = currentB.next;
    }
  }
  return currentB.data;
}




Csharp

Related
how to spawn a object in unity Code Example how to spawn a object in unity Code Example
C# list to string one line Code Example C# list to string one line Code Example
c # c^b Code Example c # c^b Code Example
c# loop array back Code Example c# loop array back Code Example
Check if two linked lists merge. If so, where? Code Example Check if two linked lists merge. If so, where? Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10