码迷,mamicode.com
首页 >  
搜索关键字:linklist    ( 405个结果
82. Remove Duplicates from Sorted List II Leetcode Python
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given...
分类:编程语言   时间:2015-02-05 13:39:58    阅读次数:152
83. Remove Duplicates from Sorted List Leetcode Python
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 定义一个pre 和cur 1.当二者...
分类:编程语言   时间:2015-02-05 09:34:25    阅读次数:189
19. Remove Nth Node From End of List Leetcode Python
Given a linked list, remove the nth node from the end of list and return its head. For example,    Given linked list: 1->2->3->4->5, and n = 2.    After removing the second node from th...
分类:编程语言   时间:2015-01-29 12:44:36    阅读次数:191
单链表的建立和增删改查代码及讲解
//---单链表的单链式存储结构---- typedef struct LNode { ElemType data; struct LNode *next; }LNode,*LinkList; //1.初始化 int Initlist(LinkList L) { L=NULL; return OK; } //初始化(带头结点) int Initlist(LinkList L) { L...
分类:其他好文   时间:2015-01-29 12:43:17    阅读次数:257
Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. 这题 是靠http://www.cnblogs.com/zuo...
分类:其他好文   时间:2015-01-24 11:38:29    阅读次数:159
判断链表是否成环,如果成环返回成环的第一个结点
#include #include typedef struct LinkNode { struct LinkNode* next; int data; }LinkList; /*说明:都带头结点的单链表*/ /*创建链表*/ void createLinkList(LinkList* head, int* a, int n) { int i = 0; Link...
分类:其他好文   时间:2015-01-24 10:17:34    阅读次数:256
判断两链表是否相交,如果相交找到第一个交点
#include #include typedef struct LinkNode { struct LinkNode* next; int data; }LinkList; /*说明:都带头结点的单链表*/ /*创建链表*/ void createLinkList(LinkList* head, int* a, int n) { int i = 0; Link...
分类:其他好文   时间:2015-01-24 10:16:27    阅读次数:156
找到链表的第K个数
#include #include typedef struct LinkNode { struct LinkNode* next; int data; }LinkList; /*创建链表*/ void createLinkList(LinkList* head, int* a, int n) { int i = 0; LinkNode* node = NULL...
分类:其他好文   时间:2015-01-24 09:00:44    阅读次数:195
Reverse Nodes in K-Groups Leetcode Python
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it ...
分类:编程语言   时间:2015-01-24 08:57:54    阅读次数:148
单链表反转问题
要求,给定一个单链表,要求对改单链表实现反转,即最后一个结点变成头结点单链表定义和建立: 1 typedef struct Node 2 { 3 int data; 4 Node * pNext; 5 }Node,*LinkList; 6 7 void CreateListHead...
分类:其他好文   时间:2015-01-20 17:28:15    阅读次数:161
405条   上一页 1 ... 32 33 34 35 36 ... 41 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!