自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 No. 47 - Search in a Rotation of an Array

参考:http://codercareer.blogspot.com/2013/03/no-47-search-in-rotation-of-array_31.html

2014-07-16 22:57:59 267

原创 Least Number after Deleting Digits

Problem: Please get the least number after deleting k digits from the input number. For example, if the input number is 24635, the least number is 23 after deleting 3 digits.参考:http://codercaree

2014-07-15 08:51:04 283

原创 Longest Substring without Duplication

Problem: Given a string, please get the length of the longest substring which does not have duplicated characters. Supposing all characters in the string are in the range from ‘a’ to ‘z’.妙处在于如何正确定

2014-07-15 02:38:40 312

原创 Numbers Appearing Once

Problem: In an array, all numbers appear three times except one which only appears only once. Please find the unique number.参考:http://codercareer.blogspot.com/2013/12/no-50-numbers-appearing-once.

2014-07-15 02:37:01 458

原创 Next Number with Same Set of Digits

Problem: Reorder the digits of a number, in order to get the next number which is the least one that is greater than the input number. For example, the number 34724126 is the next number of 34722641

2014-07-14 04:25:34 436

原创 装配线调度问题

/* Copyleft: Ming Lin */#include #include void print_line(int *l, int n){ int i; for (i = 0; i < n; i++) printf("line %d, station %d\n", l[i]+1, i+1);}int fastest_way(int s_entry[2], in

2014-07-12 23:18:18 431

原创 Maximal Product when Cutting Rope

Problem: Given a rope with length n, how to cut the rope into m parts with length n[0], n[1], ...,n[m-1], in order to get the maximal product of n[0]*n[1]* ... *n[m-1]? We have to cut once at least.

2014-07-12 14:28:22 400

原创 Longest Arithmetic Sequence - Question 3

/* Copyleft: Ming Lin */#include #include #include struct element { int key; struct element *next; struct element *tail;};struct hash { int size; struct element **head; int first;};

2014-07-12 08:32:42 428

原创 Longest Arithmetic Sequence - Question 1

Question 1: Given an array, please get the length of the longest arithmetic sequence. The element order in the arithmetic sequence should be same as the element order in the array. For example, in t

2014-07-12 05:57:24 412

原创 Three Increasing Elements in an Array

Problem: Given an array of integers A, please find three indexes i, j, k, such that ijk and A[i]j]k].cd

2014-07-10 15:35:31 274

原创 Group of 1s in a Matrix

Problem: Given a matrix with 1s and 0s, please find the number of groups of 1s. A group is defined by horizontally or vertically adjacent 1s. For example, there are four groups of 1s in Figure 1 whi

2014-07-10 13:53:37 313

转载 如何用一个月的时间准备google的技术面试

点击打开链接

2014-07-08 13:39:09 218

原创 Median in Stream

Question: How to get the median from a stream of numbers at any time? The median is middle value of numbers. If the count of numbers is even, the median is defined as the average value of the two nu

2014-07-07 14:21:30 222

原创 A Pair with the Maximal Difference

A Pair with the Maximal DifferenceProblem: A pair contains two numbers, and its second number is on the right side of the first one in an array. The difference of a pair is the minus result whil

2014-07-04 02:33:20 430

原创 Maximum Sum of All Sub-arrays

Question: A sub-array has one number of some continuous numbers. Given an integer array with positive numbers and negative numbers, get the maximum sum of all sub-arrays. Time complexity should be O(n

2014-07-03 02:30:57 391

空空如也

空空如也

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

TA关注的人

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