```c++ ListNode *reverseKGroup(ListNode *head, int k) { if (head == nullptr || head->next == nullptr || k == 1) return head; int num = 0; ListNode *pr... ...
分类:
其他好文 时间:
2018-12-25 20:16:18
阅读次数:
149
```c++ ListNode *swapPairs(ListNode *head) { if (head == nullptr || head->next == nullptr) return head; ListNode *it = head; head = head->next; it->ne... ...
分类:
其他好文 时间:
2018-12-25 12:22:45
阅读次数:
126
#include "operatexml.h"
#include ...
分类:
其他好文 时间:
2018-11-27 23:43:56
阅读次数:
348
1 语法改进 1.1 模板表达式中的空格 在c++03 及以前 c++11 1.2 nullptr 和 std::nullptr_t 在c++03 及以前 c++11 nullptr是关键词,其类型是std::nullptr_t 2 auto 自动类型推断 3 for循环 基本形式: 等价于: 或者 ...
分类:
编程语言 时间:
2018-11-25 22:17:12
阅读次数:
282
Given a linked list, determine if it has a cycle in it. Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without usi ...
分类:
其他好文 时间:
2018-11-20 13:21:06
阅读次数:
195
一 .C++入门 1.C++关键字 2.命名空间 3.C++输入&输出 4.缺省参数 5.函数重载 6.引用 7.内联函数 8.auto关键字 9.基于范围的for循环 10.指针空值nullptr&nullptr_t 二. 正文 1.C++关键字(C++98) C++98中的关键字总共用63个,如 ...
分类:
编程语言 时间:
2018-11-10 00:58:59
阅读次数:
259
1 #include 2 3 bool Find(int* matrix, int rows, int columns, int number) 4 { 5 bool result = false; 6 if(matrix != nullptr && rows > 0 && columns > 0)... ...
分类:
其他好文 时间:
2018-11-03 02:13:02
阅读次数:
190
平时在Leetcode上刷题的时候,总能看到有一些题中最快的代码都有这样一段 有时候偏偏算法是一样的,但是速度要比没有这段代码的快很多; 查了一下这段代码其实是给cin加速的,也就是说上面提到的题应该是碰到的大数据的输入,而cin cout要比scanf printf慢很多,很容易就time err ...
分类:
移动开发 时间:
2018-10-31 23:25:28
阅读次数:
380
问题:合并两个排序的链表 要求:输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。 解题代码: 递归版: 非递归版: ...
分类:
编程语言 时间:
2018-10-29 11:17:28
阅读次数:
133
1 #include 2 3 bool duplicate(int numbers[], int length, int* duplication) 4 { 5 if (numbers == nullptr || length length - 1) 10 return false; 11 12 }... ...
分类:
其他好文 时间:
2018-10-27 23:36:04
阅读次数:
297