上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页

Leetcode: String to Integer (atoi)

摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2014-12-02 15:29 Ryan-Xing 阅读(270) 评论(0) 推荐(0) 编辑

Leetcode: Valid Palindrome

摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2014-11-28 16:13 Ryan-Xing 阅读(144) 评论(0) 推荐(0) 编辑

Leetcode: Valid Parentheses

摘要: Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文
posted @ 2014-11-28 15:49 Ryan-Xing 阅读(120) 评论(0) 推荐(0) 编辑

Difference Between Vector and Deque in C++

摘要: 1) Dequeue can quickly insert or delete both at the front or the end. However, vector can only quickly insert or delete at the end.2) Memory allocatio... 阅读全文
posted @ 2014-11-28 13:47 Ryan-Xing 阅读(125) 评论(0) 推荐(0) 编辑

Leetcode: ZigZag Conversion

摘要: The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo... 阅读全文
posted @ 2014-11-26 21:53 Ryan-Xing 阅读(115) 评论(0) 推荐(0) 编辑

Leetcode: Convert Sorted List to Binary Search Tree

摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.分析:我们比较熟悉由一个sorted array生成一个BST,不同的是这里的数据... 阅读全文
posted @ 2014-11-25 20:22 Ryan-Xing 阅读(149) 评论(0) 推荐(0) 编辑

Leetcode: Copy List with Random Pointer

摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文
posted @ 2014-11-25 19:36 Ryan-Xing 阅读(101) 评论(0) 推荐(0) 编辑

Leetcode: Insertion Sort List

摘要: Sort a linked list using insertion sort.分析:insertion sort是将当前元素插入到已经排好序的元素的适当位置,时间复杂度为O(n^2)。class Solution {public: ListNode *insertionSortList(Li... 阅读全文
posted @ 2014-11-25 18:51 Ryan-Xing 阅读(119) 评论(0) 推荐(0) 编辑

Leetcode: Linked List Cycle II

摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?分析:... 阅读全文
posted @ 2014-11-25 15:05 Ryan-Xing 阅读(110) 评论(0) 推荐(0) 编辑

Leetcode: Linked List Cycle

摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?分析:如果一个linked list中有环,那么在用一个快指针和一个慢指针遍历该li... 阅读全文
posted @ 2014-11-25 14:14 Ryan-Xing 阅读(117) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页