fork download
  1. node *floydAlgo(node *head){
  2. node *slow = head;
  3. node *fast = head;
  4. node *curr = fast;
  5. node *prev = NULL;
  6. node *n;
  7. node *temp;
  8. while (fast!= NULL || fast->next!=NULL){
  9. fast = fast->next->next;
  10. slow = slow->next;
  11. if (fast == slow){
  12. temp = tail;
  13. slow = head;
  14. break;
  15. }
  16. }
  17.  
  18. while(fast != slow)
  19. {
  20. temp=temp->next
  21. slow = slow->next;
  22. curr =temp;
  23. n= curr->next;
  24. c->next = prev;
  25. prev= curr;
  26. curr=n;
  27. }
  28. prev= NULL;
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: ‘node’ does not name a type
 node *floydAlgo(node *head){
 ^~~~
stdout
Standard output is empty