- 博客(25)
- 收藏
- 关注
转载 system design
From MITBBS system designhttp://www.mitbbs.com/article_t/JobHunting/32777529.html我的面试也结束了 因为知道FLAG这类公司都会问到System Design的问题 所以这次面试着重准备了一下 在这里分享给大家 如果有不对或者需要补充的地方 大家可以留言这里说的System Design和OO
2014-09-08 22:10:43 584
原创 Sort List (merge & Insertion)
1. Sort a linked list using insertion sort. /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }
2014-07-30 12:06:50 359
原创 [面试复习] Top 10 data structure
10. queuefirst in first outin event driven operating systems, a queue is used to store the events oc
2014-07-29 04:56:15 547
原创 [LeetCode]Reverse Linked List
#include using namespace std;struct ListNode{ int val; ListNode *next; ListNode(int x): val(x), next(NULL) {} };ListNode *reverse(ListNode *head){ if(head == NULL||head->next ==NULL) return head; List
2014-07-12 15:57:28 339
原创 [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 of the list.想了好久觉得这提
2014-07-12 15:06:55 308
原创 [leetCode]Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.只能慢慢比较。
2014-07-11 05:13:28 289
原创 [LeetCode] Partition List
Partition List Total Accepted: 12453 Total Submissions: 47423My SubmissionsGiven a linked list and a value x, partition it such that all nodes less than x come before nodes greater than
2014-07-10 12:42:50 265
原创 [LeetCode] PreOrder,Inorder,PostOrder Traversal Tree
PreOrder: root->left->rightInOrder: left->root->right
2014-07-07 08:21:53 323
原创 [LeetCode]Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like: 1
2014-07-07 07:33:46 273
原创 [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 order, "()" and "()[]{}" are all va
2014-07-04 01:31:09 249
原创 [LeetCode]Merge sorted List/array
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
2014-07-02 11:22:52 392
原创 [LeetCode] Populating Next Right Pointers in Each Node I &II
I 是满二叉树,II 是任意二叉树I
2014-07-01 14:29:30 299
原创 [Leetcode]Valid Sudoku
class Solution {public: bool isValidSudoku(vector &board) { int i, j; for(i = 0;i < 9;i++) { int a[9] = {0}; for(j = 0; j < 9; j++) { if(board[i][j]!='.') { a[board[i][j]-49] += 1; if(a[board[i][j]-49
2014-07-01 01:14:29 252
原创 [LeetCode]Length of Last word
class Solution {public: int lengthOfLastWord(const char *s) { int count = 0; int i = 0; while(s[i] != '\0') { if(s[i] == ' ') { i++; } else { if(s[i-1] == ' ') { count = 1; i++; } else { count++; i++;
2014-07-01 01:08:28 251
原创 [LeetCode]Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2014-06-30 10:08:12 220
原创 [LeetCode]Single Number I
Given an array of integers, every element appears twice except for one. Find that single one.bit manipulation.
2014-06-30 06:18:09 253
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人