码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
数据结构:使用栈对链表元素位序进行反转
给定一个链表,业务需求:使用栈将链表中元素的次序进行反转。 c#代码 算法2(迭代): 时间复杂度:O(1) 文章来源:https://www.geeksforgeeks.org/program-to-reverse-a-linked-list-using-stack/ ...
分类:其他好文   时间:2019-09-01 16:41:12    阅读次数:133
【leetcode】1171. Remove Zero Sum Consecutive Nodes from Linked List
题目如下: Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences. After doin ...
分类:其他好文   时间:2019-08-31 23:18:05    阅读次数:90
数据结构:单向链表系列7--交换相邻两个节点2(交换链域/指针域)
来源:https://www.geeksforgeeks.org/pairwise-swap-elements-of-a-given-linked-list-by-changing-links/ ...
分类:其他好文   时间:2019-08-31 17:44:48    阅读次数:167
数据结构:单向链表系列5--在链表中查找元素
在链表中查找元素 函数签名: 如果在链表中查找到这个元素返回true,否则false 迭代法 java: c# 递归法: c语言: java: c# 文章来源:https://www.geeksforgeeks.org/search-an-element-in-a-linked-list-itera ...
分类:其他好文   时间:2019-08-31 17:03:55    阅读次数:151
【LeetCode】28.Linked List— Remove Linked List Elements删除链表元素
Remove all elements from a linked list of integers that have value val. Example: 说到删除,首先想到定义两个指针,分别指向要被删除的结点和该结点的前驱结点。这里还需要考虑头结点是需要删除结点的特殊情况。 ...
分类:其他好文   时间:2019-08-29 16:19:55    阅读次数:62
【LeetCode】27.Linked List—Reverse Linked List l链表逆置
Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 思路: 重塑链表, ...
分类:其他好文   时间:2019-08-29 16:13:39    阅读次数:92
Reversed Linked List(Reverse a singly linked list)
struct ListNode { int m_nKey; ListNode* next; } ListNode* reverseList(ListNode* pHead) { ListNode* pReversedHead = nullptr; ListNode* pNode = pHead; L... ...
分类:其他好文   时间:2019-08-27 22:37:45    阅读次数:104
(Easy) Reverse linked list LeetCode
Description: Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed ei ...
分类:其他好文   时间:2019-08-27 19:33:14    阅读次数:58
(Easy) Delete Node in a Linked List - LeetCode
Description: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head =  ...
分类:其他好文   时间:2019-08-27 19:21:26    阅读次数:91
Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no ...
分类:其他好文   时间:2019-08-27 01:15:11    阅读次数:127
3784条   上一页 1 ... 30 31 32 33 34 ... 379 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!