上一页 1 2 3 4 5 6 ··· 8 下一页
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algo... 阅读全文
posted @ 2014-12-08 19:23 bingtel 阅读(136) 评论(0) 推荐(0) 编辑
摘要: redis 属性文件配置:redis.host=xx.xx.xx.xxredis.port=6379#redis.pass=xxxxxredis.maxIdle=10000redis.maxTotal=100redis.timeBetweenEvictionRunsMillis=30000redis... 阅读全文
posted @ 2014-12-07 09:55 bingtel 阅读(439) 评论(1) 推荐(0) 编辑
摘要: #include "iostream.h"using namespace std;int findMedian(int *A,int left,int right){ int center = (left+right)/2; if(A[left]>A[center]){ swap(A[left],... 阅读全文
posted @ 2014-12-05 19:53 bingtel 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 快速排序#include "iostream.h"using namespace std;int findMedian(int *A,int left,int right){ int center = (left+right)/2; if(A[left]>A[center]){ swap(A[le... 阅读全文
posted @ 2014-12-05 19:03 bingtel 阅读(116) 评论(0) 推荐(0) 编辑
摘要: #include "iostream.h"using namespace std;void merge(int A[], int Tmp[], int leftStart,int rightStart, int rightEnd){ int number = rightEnd-leftStart+1... 阅读全文
posted @ 2014-12-04 19:33 bingtel 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #include "iostream.h"using namespace std;//因为i从0开始 #define LeftChild(i) (2*(i)+1)//i-N范围内,创建最大堆 void maxHeap(int A[], int i, int N){ int tmp; int chil... 阅读全文
posted @ 2014-12-04 18:45 bingtel 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2014-12-03 20:27 bingtel 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
posted @ 2014-12-03 19:17 bingtel 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"算法:根据/把path分割,再逐个判断publi... 阅读全文
posted @ 2014-11-24 22:36 bingtel 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x,n).public class Solution { public double pow(double x, int n) { //判断x是不是0 if(Math.abs(x-0)<0.0000001) retu... 阅读全文
posted @ 2014-11-23 19:53 bingtel 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 8 下一页