- 博客(15)
- 收藏
- 关注
原创 Leetcode: Nested List Weight Sum
Given a nested list of integers, return the sum of all integers in the list weighted by their depth.Different from the previous question where weight is increasing from root to leaf, now the weight
2016-09-15 13:35:08
375
原创 Leetcode: Reverse String
Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".class Solution {public: string reverseString(string s) {
2016-09-15 13:03:06
257
原创 Top K nearest points to the origin
There are n points in the xy-coordinate system. Find the top K nearest points to the origin.{(1,2), (-1,2), (3.-3),...}The idea for this problem is to use the max_heap(yes, the max heap, NOT the m
2013-12-20 12:41:20
1632
原创 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: Panama" is a palindrome."race a car" is not a
2013-12-19 11:47:59
491
原创 Leetcode: Add Two Numbers (2)
You are given two linked lists representing two non-negative numbers. The digits are storedin order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list
2013-12-18 14:19:50
562
原创 Leetcode: Add Two Numbers (1)
Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbe
2013-12-16 15:12:46
499
转载 MapReduce技术的初步了解与学习
MapReduce技术的初步了解与学习 --包含Google MapReduce中文版 今天咱们学习下MapReduce模型。由于是本人是初次接触,不是很了解。所以,有任何问题,还望各位不吝批评指正。本文中,我会先用最最通俗的语言阐述什么是MapReduce,然后再摘自Google MapReduce中文版上的一些内容,以期对这个模型有个初步的了解与认识。ok,闲不多说,下面
2013-12-16 08:54:02
852
转载 Leetcode: 题目难度等级分布 by peking2@mitbbs
IDQuestionDiffFreqData StructureAlgorithms 1Two Sum25
2013-12-16 08:38:23
6216
原创 Leetcode: Longest Substring Without Repeating Characters
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters
2013-12-16 08:30:54
497
原创 Leetcode: Median of Two Sorted Arrays
Median of Two Sorted Arrays There are two sorted arrays A and B 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)).
2013-12-15 15:56:26
583
原创 等概率随机函数和任意概率随机函数
from peking2@mitbbs题目:Given a function that will return 0 or 1 at the equal probability 0.5, called unbiased_fun(), write a function biased_fun(double p), will return 1 with probability p.我的一个面试题目
2013-11-16 13:25:42
797
原创 Facebook, Google 等大公司的面试准备-特别针对于非CS专业的
如果你是ACM竞赛的人,请跳过此文,直接找我推进你来我公司。我是一个理科生,编程语言就是大学本科的时候学的C,那时候还学过数据结构。去年7月份到今年8月份在纽约一家软件公司上班,从今年3月份开始准备骑驴找马,然后9月份跳到湾区一家大公司。其实现在这些大公司的招人过程都很程序化,题目也就是那些题目或者其变形,下面的书籍和网站是我准备面试所用到的最多的。online judge:L
2013-11-16 10:19:00
1616
原创 Leetcode: Two Sum
Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to th
2013-11-16 10:07:47
652
原创 先test一下 blog 插入c++ code的syntax hightlight
先写个所有语言一开始都用的一个程序 ”Hello world“#include int main(){ std::cout << "Hello world!" << std::endl; return 0;}
2013-11-16 06:41:11
636
原创 Google, Facebook算法题目和其他资料的讨论blog
新的工作已经稳定了,但是LD说,要时刻准备着算法的研究很熟练,有好的机会可以立即抓住!所以从现在开始在这里算是自己的算法题目的备份和其他面试资料的搜集!-2013/11/15
2013-11-16 06:34:00
884
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人