/
githubmirror
/
interviews
Обзор
Документация
Войти
/
githubmirror
/
interviews
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
cracking-the-coding-interview/chapter-two-linked-lists/DeleteNode.java
14 строк
345 B
Kevin Naughton Jr
finish renaming files and directories
27 мар 2018, 19:52
27 мар 2018, 19:52
ec6dfb5
Код
Авторство
О чём код?
//Implement an algorithm to delete a node in the middle of a singly linked list, give only access to that node public class DeleteNode { public static boolean deleteNode(LinkedListNode n) { if(n == null || n.next == null) { return false; } LinkedListNode next = n.next; n.data = next.data; n.next = next.next; return true; } }