自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(156)
  • 资源 (1)
  • 收藏
  • 关注

原创 Leetcode NO.102 Binary Tree Level Order Traversal

本题题目要求如下:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 /

2015-11-12 08:13:49 688

原创 Leetcode NO.225 Implement Stack using Queues

本题题目要求如下:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty()

2015-11-09 07:22:27 516

原创 Leetcode NO.299 Bulls and Cows

本题题目要求如下:You are playing the following Bulls and Cows game with your friend: You write a 4-digit secret number and ask your friend to guess it. Each time your friend guesses a number, you give

2015-11-06 14:18:22 919

原创 Leetcode NO.249 Group Shifted Strings

本题题目要求如下:Given a string, we can "shift" each of its letter to its successive letter, for example: "abc" -> "bcd". We can keep "shifting" which forms the sequence:"abc" -> "bcd" -> ... -> "xy

2015-10-24 07:23:55 879

原创 Leetcode NO.270 Closest Binary Search Tree Value

本题题目要求如下:Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.Note:Given target value is a floating point.You are guaranteed

2015-10-23 11:12:54 825

原创 Leetcode NO.246 Strobogrammatic Number

本题题目要求如下:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to determine if a number is strobogrammatic. The number is

2015-10-23 08:17:37 667

原创 Leetcode NO.252 Meeting Rooms

本题题目要求如下:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings.For example,Given [[0

2015-10-23 07:44:23 1744

原创 Leetcode NO.243 Shortest Word Distance

本题题目要求如下:Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list.For example,Assume that words = ["practice", "makes", "perfec

2015-10-23 07:19:50 707

原创 Leetcode NO.266 Palindrome Permutation

本题题目要求如下:Given a string, determine if a permutation of the string could form a palindrome.For example,"code" -> False, "aab" -> True, "carerac" -> True.这题是Easy题,所以难度不大,就是用hashmap来存储,不能

2015-10-20 05:41:37 705

原创 Leetcode NO.293 Flip Game

本题题目要求如下:You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take turns to flip twoconsecutive "++" i

2015-10-20 05:21:44 754

原创 Leetcode NO.8 String to Integer (atoi)

本题题目要求如下:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the po

2015-10-13 13:27:03 465

原创 Leetcode NO.125 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: Panama" is a palindrome."race a

2015-10-11 05:39:03 502

原创 Leetcode NO.290 Word Pattern

本题题目要求如下:Given a pattern and a string str, find if str follows the same pattern.Examples:pattern = "abba", str = "dog cat cat dog" should return true.pattern = "abba", str = "dog

2015-10-08 04:50:16 395

原创 Leetcode NO.42 Trapping Rain Water

本题题目要求如下:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1

2015-10-08 04:19:58 406

原创 Leetcode NO.45 Jump Game II

本题题目要求如下:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.

2015-10-07 08:01:28 335

原创 Leetcode NO.55 Jump Game

本题题目要求如下:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.

2015-10-07 06:58:06 263

原创 Leetcode NO.278 First Bad Version

本题题目要求如下:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is develop

2015-10-07 05:48:58 347

原创 Leetcode NO.274 H-Index

本题题目要求如下:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.According to the definition of h-index on

2015-10-05 12:16:09 334

原创 Leetcode NO.53 Maximum Subarray

本题题目要求如下:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarra

2015-10-05 11:26:36 354

原创 Leetcode NO.232 Implement Queue using Stacks

本题题目要求如下:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front

2015-10-05 08:50:15 291

原创 Leetcode NO.223 Rectangle Area

本题题目要求如下:Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assum

2015-10-03 07:20:22 294

原创 技术面试(操作系统)

操作系统课我虽然上过,但是因为上操作系统课的时候,英语还很烂,听不懂老师说啥,此外,我之前从没有修过OS的先修课程,比如CSAPP或者系统编程之类的,所以学的很不扎实,当时吸收的效果一般,最近在准备面试,也遇到过操作系统的问题,如果从现在开始看操作系统的书,肯定是来不及了,所以要注意总结,搜集一些同学遇到的或者网上常考的题,努力去理解这些知识点。NO.1 System Call

2015-09-28 12:15:32 769

原创 技术面试(C++)

面试中也曾经遇到过一些语法类的问题,大部分能够解决,但是也有很多做不出来,今天开始进行C++语法的总结,尤其因为我完全不用Java,所以,C++语法就显得愈加重要,开始阶段可能是一些我已经掌握的表面的知识,之后就是一些比较深层次或者偏门的知识,希望能一天一道,20天左右总结一遍。。另外,如果各位看到我blog的同学或者前辈觉得我写的有啥错误,也请不吝赐教,因为我C++用的时间并不长,很

2015-09-26 08:20:48 1513

原创 Leetcode NO.279 Perfect Squares

本题题目要求如下:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4

2015-09-25 11:29:24 1219 1

原创 Leetcode NO.4 Median of Two Sorted Arrays

本题题目要求如下:There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).题目的要求并不复杂,但是

2015-09-25 11:05:58 549

原创 技术面试(算法)

主要介绍我在北美求职技术面中遇到的题目以及在准备中刷的面经,本版专门针对算法题,将来也会写专门针对C++和操作系统的。。NO.1 Valid Parentheses本题出处是我准备Wepay的电面的面经,来自一亩三分地论坛本题是Leetcode原题,直接参考我写的blog: Leetcode NO.20NO.2 3Sum本题出处也是我准备Wepay的电面面经,来

2015-09-22 07:03:57 1627

原创 Leetcode NO.136 Single Number

本题题目要求如下:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it wi

2015-09-22 06:21:27 391

原创 Leetcode NO.141 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?本题还是比较简单的,就是快慢指针的问题,如果快指针可以追上慢指针,就有cycle,否则就没有。。快指针每次移动两步,慢指针一步,代码如下:

2015-09-21 12:33:35 326

原创 A WORDGAME: HANGMAN

这道题是EDX上的课程:MITx: 6.00.1x Introduction to Computer Science and Programming Using Python第三周的作业题,是猜单词游戏,应该大家都玩过,可以参考下维基百科:hangman, 当然也可以看

2015-09-21 10:54:16 2394 1

原创 Leetcode NO.129 Sum Root to Leaf Numbers

本题题目要求如下:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.

2015-09-14 10:29:19 365

原创 Leetcode NO.220 Contains Duplicate III

本题题目要求如下:Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] andnums[j] is at most t and the difference be

2015-09-11 06:45:17 382

原创 Leetcode NO.219 Contains Duplicate II

本题题目要求如下:Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is a

2015-09-11 06:19:13 224

原创 Leetcode NO.226 Invert Binary Tree

本题题目要求如下:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1。。。。前一段时间,这道题挺火的。。说一个面谷歌的大神没做出来。。。反正我是不信。。。这几乎是leetcode最简单

2015-07-29 13:17:52 313

原创 Leetcode NO.19 Remove Nth Node From End of List

本题题目要求如下:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node fr

2015-07-29 12:53:31 332

原创 Leetcode NO.139 Word Break

本题题目要求如下:Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",

2015-07-29 06:42:02 537

原创 Leetcode NO.13 Roman to Integer

本题题目要求如下:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.本题题目还是很简单的,就是设一个hashmap,让字母和对应数字分别为key和value需要注意的是如果后面字母大于前面字母对应的数字,应该是

2015-07-27 07:22:31 496

原创 Two Sigma面试专题

前段时间过了Two Sigma的第一轮HR面后,就一直没有管,最近准备把Two Sigma的OA做了,不过还是提前准备下,从网上找了几道面经,准备写一写,尽量能过OA面吧,如果过了,下一轮就是技术电话面试。。。以前还从未有过这样的面试,所以想这次试一试。。Two Sigma NO.1 Friend CircleProblem StatementThere

2015-07-25 04:56:51 10828

原创 Leetcode NO.20 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 "()[]{

2015-07-24 09:40:06 469

原创 Leetcode NO.170 Two Sum III - Data structure design

本题题目要求如下:Design and implement a TwoSum class. It should support the following operations: add and find.add - Add the number to an internal data structure.find - Find if there exists any pa

2015-07-24 05:35:06 377

原创 Leetcode NO.111 Minimum Depth of Binary Tree

本题题目要求如下:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.这道题是一道很简单的题目,基本思想就是DF

2015-07-23 07:09:58 330

Algorithm in C++, Part 1 - Part 4

这本书是我们上课时用的教材,质量应该还算不错吧,因为没有看完,只是看上课需要的部分,所以无权评价全部东西。但是本书以及本书作者还是比较有名的,学算法的肯定都知道的。MOOC上讲课的普林斯顿大牛 相比较于传说中经典的Intro to Algorithm,真本书更侧重于算法的C++实现,而非理论,对于纯CS的学生,可以绕道。。但是对于工程类专业,这本书应该是更好的选择。 P.S.如果谁有part 5图论,跟我联系下,求分享。。。另外,如果确实是跟我积分一样少的穷人,联系我,给个邮箱,我发给你。。

2014-02-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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