自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 31. Next Permutation

实现“下一个排列”函数,将排列中的数字重新排列成字典序中的下一个更大的排列。如果这样的重新排列是不可能的,它必须重新排列为可能的最低顺序(即升序排序)。重排必须在原地,不分配额外的内存。以下是一些示例,左侧是输入,右侧是输出:1,2,3 → 1,3,2 3,2,1 → 1,2,3 1,1,5 → 1,5,1网上看来一个示例,觉得挺好的,也没必要另外找一个了。6 5 4 8 7 5 1 一开始没

2016-04-27 17:22:04 627

原创 22. Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:“((()))”, “(()())”, “(())()”, “()(())”, “()()()”求出所以可能

2016-04-27 12:14:23 536

原创 21. Merge Two Sorted Lists

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./** * Definition for singly-linked list. * struct ListNo

2016-04-27 12:05:43 567

原创 18. 4Sum

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: Elements in a quad

2016-04-27 11:46:20 810

原创 16. 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly

2016-04-27 11:42:32 541

原创 15. 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: Elements in a triplet (a,b,c) must be i

2016-04-27 11:22:33 500

原创 11. Container With Most Water

题目:Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two

2016-04-26 22:52:36 510

原创 338. Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example: For num = 5 you sh

2016-04-26 22:19:39 584

原创 343. Integer Break

Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2, return 1

2016-04-26 22:17:07 548 1

哈夫曼编码(带中文压缩)

利用优先级队列+DFS优化的哈夫曼编码译码器,可进行中文压缩,最高压缩率可达到1:3

2015-01-03

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

TA关注的人

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