摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文
posted @ 2017-11-13 21:10 hozhangel 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Merge k sorted linked list就是merge 2 sorted linked l 阅读全文
posted @ 2017-11-13 20:35 hozhangel 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 在Vector容器中有以下几个关于大小的函数 方法 效果 size() 返回容器的大小 empty() 判断容器是否为空 max_size() 返回容器最大的可以存储的元素 capacity() 返回容器当前能够容纳的元素数量 LeetCode内对vector元素排序。std::sort(nums. 阅读全文
posted @ 2017-11-13 19:43 hozhangel 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: 解 阅读全文
posted @ 2017-11-13 19:33 hozhangel 阅读(189) 评论(0) 推荐(0) 编辑