自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 (LintCode) No 5: Swap Two Integers in Array

题目描述:交换一个数列中两个数字的位置。代码如下:public class Solution { /** * @param A: An integer array * @param index1: the first index * @param index2: the second index * @return: nothing */ ...

2018-03-16 21:20:42 258

原创 (LintCode) No 4: Reverse 3-digit Integer

题目描述:将一个三位数逆序并输出这个数字,注意不是数列而是数字。代码如下:class Solution { public: /** * @param number: A 3-digit number. * @return: Reversed number. */ int reverseInteger(int number) { int ...

2018-03-16 21:17:19 649

原创 (LintCode) No 3: Sort Integers

题目描述:使用算法复杂度为O(n^2)的排序算法进行整数排序。启迪总结:c++中内置了很多功能,可以直接使用,前提是知道存在什么功能并且知道如何正确使用。代码如下:class Solution { public: /** * @param A: an integer array * @return: nothing */ void sortIntege...

2018-03-16 21:14:04 217

原创 (LintCode) No 2: Fabonacci

题目描述:输出对应的第几项数值。代码如下:class Solution { public: /** * @param n: an integer * @return: an ineger f(n) */ int fibonacci(int n) { // write your code here int a = 0, b...

2018-03-16 19:44:11 192

原创 (LintCode) No 1: Hex Conversion

题目描述:如标题代码如下:没什么好说的class Solution { public: /** * @param n: a decimal number * @param k: a Integer represent base-k * @return: a base-k number */ string hexConversion(int n...

2018-03-04 17:14:57 797

空空如也

空空如也

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

TA关注的人

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