question; write a method remove() that takes a linked list and a string key as arguments and removes all of the nodes in the list that have key as its ...
分类:
其他好文 时间:
2018-05-19 14:47:01
阅读次数:
214
question: write a method max() that takes a reference to the first node in a linked list as argument and returns the value of the maxnimun key in the ...
分类:
其他好文 时间:
2018-05-19 14:41:29
阅读次数:
176
question: write a method removeafter() that takes a linked-list node as argument and removes the node following the given one(and does nothing if the ...
分类:
其他好文 时间:
2018-05-19 14:02:53
阅读次数:
124
question: write a method insertafter() that takes two linked-list node arguments and inserts the second after the first on its list(and does nothing i ...
分类:
其他好文 时间:
2018-05-19 14:02:19
阅读次数:
152
question: suppose that x is a linked list node. what does the following code fragment do? answer: inserts node t immediately after node x. ...
分类:
其他好文 时间:
2018-05-19 13:10:18
阅读次数:
155
question: write a method find() that takes a linked list and a string key as arguments and returns true if some node in the list has the key as its it ...
分类:
其他好文 时间:
2018-05-19 13:03:05
阅读次数:
152
Given a linked list, swap every two adjacent nodes and return its head.Example:Given 1->2->3->4, you should return the list as 2->1->4->3.Note:Your al... ...
分类:
其他好文 时间:
2018-05-18 00:35:22
阅读次数:
168
Solution1: Reverse and Compare 翻转整个Linked List, 然后用两个指针进行逐一比对 Solution2: Iterative Approach use Stack java class Result { public ListNode node; public ...
分类:
其他好文 时间:
2018-05-17 11:59:36
阅读次数:
151
问题描述: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. 我的思路: 在Link ...
分类:
其他好文 时间:
2018-05-17 11:52:54
阅读次数:
134
问题描述: Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: 我的思路: 现将链表里的值存储到一个vector中,然后在对vector从两边向中心对比,空间复杂度为O(n), 时间复杂 ...
分类:
其他好文 时间:
2018-05-17 11:50:26
阅读次数:
160