Remove Nth Node From End of List

Descrição

FlashCards sobre Remove Nth Node From End of List, criado por Suhas S em 17-02-2018.
Suhas S
FlashCards por Suhas S, atualizado more than 1 year ago
Suhas S
Criado por Suhas S quase 8 anos atrás
3
0

Resumo de Recurso

Questão Responda
Remove Nth Node From End of List public ListNode removeNthFromEnd(ListNode head, int n) { ListNode first = new ListNode(0); first.next = head; ListNode fast = first, slow = first; while(fast.next != null){ fast = fast.next; if(n-- < 1 ) slow = slow.next; } slow.next = slow.next.next; return first.next; }

Semelhante

Linked List
Subash M
Delete Node in a BST
Suhas S
Delete a node with a key
Suhas S
Swap Nodes in Pairs
Suhas S
Merge Two Sorted Lists
Suhas S
Odd Even Linked List
Suhas S
Rotate List
Suhas S
Add Two Numbers
Suhas S
Copy List with Random Pointer
Suhas S