自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

无知的博客

所知甚少唯愿学

  • 博客(16)
  • 资源 (3)
  • 收藏
  • 关注

原创 剑指offer - 数字在排序数组中出现的次数

#include<string.h>class Solution {public: int GetNumberOfK(vector<int> data ,int k) { int len=data.size(); vector<int> v(10000); for(int i=0; i<len; i++) {

2016-08-04 21:31:16 374

原创 剑指offer - 把数组排成最小的数

import java.util.ArrayList;import java.util.Arrays;import java.util.Collection;import java.util.Comparator;public class Solution { public static String PrintMinNumber(int [] numbers) {

2016-08-04 21:22:33 341

原创 剑指offer - 整数中1出现的次数

public class Solution { public int NumberOf1Between1AndN_Solution(int n) { int res=0; for(int i=1;i<=n;i++) { res+=bt(i); } return res; }

2016-08-04 21:20:33 345

原创 剑指offer - 连续子数组的最大和

public class Solution { public int FindGreatestSumOfSubArray(int[] a) { if(a.length==0) return 0; int res=0; int maxx=-1000000000; for (int i = 0; i < a.l

2016-08-04 21:19:57 264

原创 剑指offer - 最小的K个数

class Solution {public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { vector<int> res; if(input.empty()||input.size()<k||k<=0) return res;

2016-08-04 21:17:23 241

原创 剑指offer - 数组中出现次数超过一半的数字

public class Solution { public int MoreThanHalfNum_Solution(int [] array) { int vis[]=new int[10001]; for (int i = 0; i < array.length; i++) { vis[array[i]]++;

2016-08-04 21:16:15 354

原创 剑指offer - 顺时针打印矩阵

class Solution {public: vector<int> printMatrix(vector<vector<int> > matrix) { int row = matrix.size(); int col = matrix[0].size(); vector<int> res; // 输入的二维数组非法,返回空

2016-08-04 21:15:18 535

原创 剑指offer - 调整数组顺序使奇数位于偶数前面

public class Solution { public void reOrderArray(int [] array) { int a[]=new int[1001]; int cnt1=0; for (int i = 0; i < array.length; i++) { if(array[i]%2==1)

2016-08-04 21:14:16 411

原创 剑指offer - 数值的整数次方

public class Solution { public double Power(double base, int n) { double sum=1.00000000; for (int i = 0; i <(n>=-n?n:-n); i++) { sum*=base; } if(n>=0)

2016-08-04 21:13:34 412

原创 剑指offer - 二进制中1的个数

public class Solution { public int NumberOf1(int n) { int sum=0; while(n!=0) { n=((n-1)&n); sum++; } return sum; }}

2016-08-04 21:12:42 322

原创 剑指offer - 矩形覆盖

public class Solution { public int RectCover(int target) { int []a=new int[101]; a[1]=1; a[2]=2; for (int i = 3; i < a.length; i++) { a[i]=a[i-1]

2016-08-04 21:11:09 399

原创 剑指offer - 变态跳台阶

找规律题public class Solution { public int JumpFloorII(int n) { int sum=1; for(int i=1;i<n;i++) sum<<=1; return sum; }}

2016-08-04 21:09:38 387

原创 剑指offer - 旋转数组的最小数字

直接上代码import java.util.ArrayList;public class Solution { public int minNumberInRotateArray(int [] a) { for(int i=0;i<a.length;i++) { if(a[i+1]<a[i]) {

2016-08-04 21:07:52 234

原创 剑指offer - 从尾到头打印链表

水题/*** public class ListNode {* int val;* ListNode next = null;** ListNode(int val) {* this.val = val;* }* }**/import java.util.*;public class S

2016-08-04 21:05:18 327

原创 剑指offer - 替换空格

直接上代码import java.util.*;public class Solution { public String replaceSpace(StringBuffer str) { String str1=str.toString(); char a[]=str1.toCharArray(); String res="";

2016-08-04 21:02:46 308

原创 剑指offer 二维数组中的查找

剑指offer 二维数组中的查找从右上角出发,轻松解决:)代码如下public class Solution { public boolean Find(int [][] a,int target) { int n=a.length; int m=a[0].length; int i=0; int j=m-1; i

2016-08-04 20:59:55 293

MyEclipse 2015 Stable 2.0破解

MyEclipse 2015 Stable 2.0破解,记得点赞哦,不懂参照http://www.bubuko.com/infodetail-976160.html或者贴吧

2015-10-25

空空如也

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

TA关注的人

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