自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 资源 (2)
  • 收藏
  • 关注

原创 LeetCode 1.Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use thesame

2017-07-02 23:16:03 176

原创 AngularJS中ng-change不生效

onchange会使ng-change失效。 解决方法: 使用onchange,例如onchange=”angular.element(this).scope().testFunction()”

2016-12-15 17:16:18 5190

转载 不同浏览器keyCode

keyCode

2016-09-18 21:01:36 776

原创 Java实现的堆排序(最小堆)

//堆排序的实现(最小堆) public class HeapSort {static int temp;public static void shift(int r[],int k,int m){//筛选法调整堆 int i=k,j=k*2; while(j<=m){ if(j<m&&r[j]<r[j+1]) j++; if(r[i]<r[j])

2015-09-17 16:58:56 381

原创 LeetCode:Excel Sheet Column Number

Excel Sheet Column Number Total Accepted: 31455 Total Submissions: 86178My SubmissionsQuestion Solution Related to question Excel Sheet Column TitleGiven a column title as appe

2015-06-24 20:39:05 229

原创 LeetCode:Number of 1 Bits

Number of 1 Bits Total Accepted: 34078 Total Submissions: 91348My SubmissionsQuestion Solution Write a function that takes an unsigned integer and returns the number of ’1' bits

2015-06-24 20:34:36 187

原创 LeetCode:Best Time to Buy and Sell Stock II

Best Time to Buy and Sell Stock II Total Accepted: 49789 Total Submissions: 130095My SubmissionsQuestion Solution Say you have an array for which the ith element is the price of

2015-06-24 20:31:55 318

原创 LeetCode:Same Tree

Same Tree Total Accepted: 65115 Total Submissions: 155756My SubmissionsQuestion Solution Given two binary trees, write a function to check if they are equal or not.Two binary t

2015-06-24 20:05:02 184

原创 LeetCode:Maximum Depth of Binary Tree

Maximum Depth of Binary Tree Total Accepted: 69754 Total Submissions: 154717My SubmissionsQuestion Solution Given a binary tree, find its maximum depth.The maximum depth is the

2015-06-24 19:58:57 173

转载 LeetCode:Single Number

Single Number Total Accepted: 74470 Total Submissions: 165136My SubmissionsQuestion Solution Given an array of integers, every element appears twice except for one. Find that sin

2015-06-24 19:49:33 202

银行家算法

#include<iostream> #include<fstream> #include<string> using namespace std; ifstream fin("in.txt"); //ofstream fout("E:\\out.txt"); const int P=100,S=100; int Available[S]; int Max[P][S]; int Allocation[P][S]; int Need[P][S]; int Request[P][S]; int Work[S]; bool Finish[P]; bool flag=true; int Count[P]; int k; bool Safe(int a,int b){ int i,j; k=0; for(i=0;i<b;i++) Work[i]=Available[i]; for(j=0;j<a;j++) Finish[j]=false; for(i=0;i<a;i++){ if(Finish[i]==false){ for(j=0;j<b;j++){ if(Need[i][j]>Work[j]){ break; } } if(j==b){ Finish[i]=true; for(j=0;j<b;j++){ Work[j]=Work[j]+Allocation[i][j]; } Count[k++]=i;//存储安全序列 i=-1; } } } for(i=0;i<a;i++){ if(Finish[i]==false){ break; } } if(i==a){ return true; } return false; }

2014-11-19

操作系统 读者写着作业

使用netbeans编写,有界面 使用多线程 包含读者优先与写者优先

2014-11-19

空空如也

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

TA关注的人

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