码迷,mamicode.com
首页 >  
搜索关键字:listnode    ( 1413个结果
147. 对链表进行插入排序
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), next(NULL) {} 7 * }; ...
分类:编程语言   时间:2020-04-03 12:22:52    阅读次数:63
单向链表翻转
#include <stdio.h> #include <stdlib.h> typedef struct ListNode { int val; struct ListNode *next; }ListNode; ListNode* ReverseList(ListNode* pHead) { i ...
分类:其他好文   时间:2020-04-02 22:45:25    阅读次数:56
leetcode-面试题6-从尾到头打印链表
题目描述: java /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ class ...
分类:其他好文   时间:2020-04-02 17:39:14    阅读次数:49
leetcode 82 Remove Duplicates from Sorted List II
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu ...
分类:其他好文   时间:2020-04-01 16:35:39    阅读次数:55
109. 有序链表转换二叉搜索树
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), next(NULL) {} 7 * }; ...
分类:其他好文   时间:2020-04-01 15:00:17    阅读次数:56
学习数据结构的第五天(三)
class Solution { public ListNode removeElements(ListNode head, int val) { //如果没有前置头,那么需要分是头还是链身 //给它加一个前置头哈哈 ListNode dummyHead=new ListNode(-1); //删除 ...
分类:其他好文   时间:2020-03-31 22:55:26    阅读次数:63
listNode.c
#include <stdio.h> #include <stdlib.h> #include <ctype.h> typedef struct listNode { int data; struct listNode *nextPtr; }LISTNODE; void instructions ( ...
分类:其他好文   时间:2020-03-28 14:59:45    阅读次数:76
《剑指offer》第二十四题:反转链表
// 面试题24:反转链表 // 题目:定义一个函数,输入一个链表的头结点,反转该链表并输出反转后链表的 // 头结点。 #include <cstdio> #include "List.h" ListNode* ReverseList(ListNode* pHead) { ListNode* pR ...
分类:其他好文   时间:2020-03-27 01:08:33    阅读次数:60
《剑指offer》第十八题:在O(1)时间删除链表结点
// 面试题18(一):在O(1)时间删除链表结点 // 题目:给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间删除该 // 结点。 #include <cstdio> #include "List.h" void DeleteNode(ListNode** pListHead, Li ...
分类:其他好文   时间:2020-03-24 23:38:24    阅读次数:134
python(2)
class Solution: def reversePrint(self, head: ListNode) -> List[int]: newList=[] while head: newList.append(head.val) head=head.next return newList[::- ...
分类:编程语言   时间:2020-03-24 11:03:57    阅读次数:67
1413条   上一页 1 ... 15 16 17 18 19 ... 142 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!