摘要:
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... 阅读全文
摘要:
redis 属性文件配置:redis.host=xx.xx.xx.xxredis.port=6379#redis.pass=xxxxxredis.maxIdle=10000redis.maxTotal=100redis.timeBetweenEvictionRunsMillis=30000redis... 阅读全文
摘要:
#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],... 阅读全文
摘要:
快速排序#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... 阅读全文
摘要:
#include "iostream.h"using namespace std;void merge(int A[], int Tmp[], int leftStart,int rightStart, int rightEnd){ int number = rightEnd-leftStart+1... 阅读全文
摘要:
#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... 阅读全文
摘要:
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... 阅读全文
摘要:
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... 阅读全文
摘要:
Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"算法:根据/把path分割,再逐个判断publi... 阅读全文
摘要:
Implement pow(x,n).public class Solution { public double pow(double x, int n) { //判断x是不是0 if(Math.abs(x-0)<0.0000001) retu... 阅读全文