
链表
文章平均质量分 69
大团子
爱好计算机
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
剑指offer--面试题13:在O(1)时间删除链表结点
#include #include typedef struct node { int data; struct node *next; }Node,*LinkList; LinkList Create_Tail_LinkList(LinkList &L,int length) //尾插法建单链表 { Node * s,*r; L=(LinkList)malloc(sizeof(N原创 2017-04-22 21:09:34 · 650 阅读 · 0 评论 -
剑指offer--面试题22:链表中倒数第k个节点
#include #include typedef struct node { int data; struct node *next; }Node,*LinkList; Node *FindKthToTail(LinkList L, unsigned int k) { if (L->next == NULL || k == 0原创 2017-07-15 16:07:44 · 279 阅读 · 0 评论 -
剑指offer--面试题24:反转链表
#include #include //****************************************宏定义****************************************************** typedef int ElemType; typedef struct node { ElemType data; struct node *next; }N原创 2017-07-15 20:42:11 · 341 阅读 · 0 评论 -
剑指offer--面试题6:从头到尾打印链表
#include #include #include using namespace std; typedef struct node { int data; struct node *next; }Node,*LinkList; LinkList Create_List_Tail(int length) {//建立链表 Node *L,*s,*r; //L指向头结点,r原创 2017-06-27 21:26:24 · 305 阅读 · 0 评论 -
剑指offer--面试题23:链表中环的入口节点
#include #include #define nullptr NULL struct ListNode { int m_nValue; ListNode* m_pNext; }; ListNode* CreateListNode(int value) { ListNode* pNode = new ListNode();原创 2017-07-15 20:19:39 · 304 阅读 · 0 评论 -
剑指offer--面试题18:删除链表的结点
#include #include struct ListNode { int m_nValue; ListNode* m_pNext; }; ListNode* CreateListNode(int value) { ListNode* pNode = new ListNode(); pNode->m_nValue = value; pN原创 2017-07-14 20:33:52 · 258 阅读 · 0 评论 -
剑指offer--面试题25:合并两个排序的链表
#include #include typedef struct Node { int data; struct Node *next; }LNode,*LinkList; LinkList Create_List() { int num; LNode *r,*s; LinkList L=(LinkList)malloc(sizeof(LNode)); L->next=NULL;原创 2017-07-22 14:46:00 · 270 阅读 · 0 评论 -
1、O(1)时间内删除链表节点
# _*_coding:utf-8 _*_ class ListNode: def __init__(self): self.val = None self.next = None class Solution: def __init__(self): return def list_generate(sel...原创 2019-03-16 22:22:07 · 133 阅读 · 0 评论