Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

merge point

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;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# how to terminate console application 
Csharp :: fluentassertions force exceptions 
Csharp :: Prevent player rotation unity 
Csharp :: deltatime 
Csharp :: mathf.clamp unity 
Csharp :: c# string is not null or empty 
Csharp :: unity set material 
Csharp :: c# linq remove duplicate items from list of integer 
Csharp :: c# loop through files in folder 
Csharp :: datagridview column color c# 
Csharp :: color picker wpf 
Csharp :: c# combine list of bool 
Csharp :: json.net deserialize dynamic 
Csharp :: stop a thread c# 
Csharp :: get time from datetime c# 
Csharp :: how to set up blender with unity units 
Csharp :: c# cast to type variable 
Csharp :: how to move a gameobject to another object 
Csharp :: print content of array c# 
Csharp :: cast int to enum type c# 
Csharp :: C# get key by value Dict 
Csharp :: dota2 
Csharp :: check if animation is playing unity 
Csharp :: convert object to array in c# 
Csharp :: how delete multiple row from relation in laravel 
Csharp :: C# tolower all in a array 
Csharp :: System command c# 
Csharp :: C# calculate sum of digits of a number 
Csharp :: c# get char from string 
Csharp :: c# access session in class 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =