Skip to content

Instantly share code, notes, and snippets.

@Zerk123
Created September 27, 2015 07:33
Show Gist options
  • Select an option

  • Save Zerk123/fd693bc597e53616cdc0 to your computer and use it in GitHub Desktop.

Select an option

Save Zerk123/fd693bc597e53616cdc0 to your computer and use it in GitHub Desktop.
void JosuphProb(int jump){
node *temp = head;
node *temp1 = head;
while (temp != head)
for (int i = 0; i < jump - 2; i++){
temp = temp->next;
}
for (int i = 0; i < jump - 1; i++){
temp1 = temp1->next;
}
temp->next = temp1->next;
temp1 = temp;
if (temp == head){
head = head->next;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment