请判断一个链表是否为回文链表。 示例 1: 输入: 1->2 输出: false 示例 2: 输入: 1->2->2->1 输出: true /** * Definition for singly-linked list. * public class ListNode { * int val; * ...
分类:
其他好文 时间:
2020-04-04 19:01:43
阅读次数:
62
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
题目描述: 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
/** * 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
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
Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va ...
分类:
其他好文 时间:
2020-04-01 00:34:43
阅读次数:
61
额,快慢指针,单指针是没必要当作题来做的。 /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func middleNode(head *ListNo ...
分类:
其他好文 时间:
2020-03-23 23:35:00
阅读次数:
115
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-03-22 01:19:40
阅读次数:
66
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-03-21 23:09:33
阅读次数:
48
#include <iostream>#include <string>using namespace std;struct Node{ Node() :value(0), pNext(nullptr) {} int value; Node* pNext;};class CLinkList{priv ...
分类:
其他好文 时间:
2020-03-21 09:52:22
阅读次数:
56