自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(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] Next Permutation

寻找数组字典序的下一个。

2014-07-11 01:10:32 157

原创 [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] PathSum

惭愧啊。完全不会递归。自从看了combination的答案以后每题都是an

2014-07-08 01:37:00 338

原创 [LeetCode] 3Sum

觉得这题比twosum简单。不用返回index觉得好做一些。

2014-07-07 10:07:05 257

原创 [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] Jump Game

一维DP转移方程jump[i] = max(jump[i-1],

2014-07-06 12:49:36 307

原创 [LeetCode] Combination, Permutation, subsets

三道几乎一样的题 递归~Combination:

2014-07-04 14:28:45 390

原创 [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]Palindrome Number & reverse integer

没神马可说的 两题类似 %10 和/10不断地用

2014-07-03 15:09:42 267

原创 [LeetCode]Sum Root to Leaf Numbers

已经在leetcode看到很多这种题了 建个queue

2014-07-03 12:24:09 286

原创 [LeetCode]Spiral Matrix I & II & Rotate Matrix

矩阵神马的最讨厌了!!转的我头疼

2014-07-03 10:15:29 430

原创 [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]Two Sum

两种做法。第一种用hash 把vector里的数存进

2014-07-01 06:00:13 274

原创 [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关注的人

提示
确定要删除当前文章?
取消 删除