Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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

PREVIOUS NEXT
Code Example
Csharp :: unity how to stop the game 
Csharp :: select a object from list based on a value csharp 
Csharp :: consecutive numbers c# 
Csharp :: c# combobox selectedvalue 
Csharp :: tooltips unity 
Csharp :: how to change loaded scene in unity 
Csharp :: asp.net core identity get user id 
Csharp :: singleton unity 
Csharp :: c# string array initialization 
Csharp :: create char array c# 
Csharp :: c# compile just one exe 
Csharp :: c# how to refresh your binding source 
Csharp :: memset alternative in c# 
Csharp :: c# read file current directory 
Csharp :: c# datagridview column size 
Csharp :: know to which direction Vector.MoveTowards is moving unity 2D 
Csharp :: add rotation unity c# 
Csharp :: c# linq select from object list 
Csharp :: how to access individual characters in a string in c# 
Csharp :: remove comma from string c# 
Csharp :: Get key by his value on Dict C# 
Csharp :: unity vscode no autocomplete 
Csharp :: unity detect keyboard not mouse 
Csharp :: write line to file c# 
Csharp :: mvc get base url 
Csharp :: get last element in a list vb.net 
Csharp :: The server requested authentication method unknown to the client 
Csharp :: get char lowercase in c# 
Csharp :: c# inline array initialization 
Csharp :: how to convert float to int c# 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =