上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 34 下一页

2015年3月22日

(转)基于快速排序的TOPK算法

摘要: 基于快速排序的TOPK算法转自:http://blog.csdn.net/fanzitao/article/details/7617223思想:类似于快速排序,首先选择一个划分元,如果这个划分元的序号index刚好等于k,那么这个划分元以及左边的数,刚好组成了top-k small data;如果i... 阅读全文

posted @ 2015-03-22 16:37 zhouzhou0615 阅读(1618) 评论(0) 推荐(0) 编辑

Number of 1 Bits

摘要: Number of 1 Bits问题:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exa... 阅读全文

posted @ 2015-03-22 14:35 zhouzhou0615 阅读(162) 评论(0) 推荐(0) 编辑

Word Search

摘要: Word Search问题:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell,... 阅读全文

posted @ 2015-03-22 14:26 zhouzhou0615 阅读(120) 评论(0) 推荐(0) 编辑

Rotate Array

摘要: Rotate Array问题:Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].思... 阅读全文

posted @ 2015-03-22 13:57 zhouzhou0615 阅读(148) 评论(0) 推荐(0) 编辑

Reverse Words in a String

摘要: Reverse Words in a String问题:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".思路... 阅读全文

posted @ 2015-03-22 11:04 zhouzhou0615 阅读(105) 评论(0) 推荐(0) 编辑

2015年3月21日

Repeated DNA Sequences

摘要: Repeated DNA Sequences问题:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, i... 阅读全文

posted @ 2015-03-21 11:46 zhouzhou0615 阅读(160) 评论(0) 推荐(0) 编辑

Maximum Product Subarray

摘要: Maximum Product Subarray问题:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, gi... 阅读全文

posted @ 2015-03-21 10:12 zhouzhou0615 阅读(132) 评论(0) 推荐(0) 编辑

2015年3月19日

ZigZag Conversion

摘要: ZigZag Conversion问题:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this patter... 阅读全文

posted @ 2015-03-19 16:55 zhouzhou0615 阅读(247) 评论(0) 推荐(0) 编辑

Reverse Nodes in k-Group

摘要: Reverse Nodes in k-Group问题:Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is no... 阅读全文

posted @ 2015-03-19 16:15 zhouzhou0615 阅读(114) 评论(0) 推荐(0) 编辑

Word Break

摘要: Word Break问题:Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary wor... 阅读全文

posted @ 2015-03-19 15:11 zhouzhou0615 阅读(130) 评论(0) 推荐(0) 编辑

上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 34 下一页

导航