12 2014 档案

摘要:先附源码:package java.util;import java.io.*;/** * This class implements a hash table, which maps keys to values. Any * non-null object can be used as a ke... 阅读全文
posted @ 2014-12-30 16:39 bingtel 阅读(210) 评论(0) 推荐(0)
摘要:Session是由服务器端的应用服务器容器(如Tomcat、Jetty)存储的。下面分析一下Tomcat是如何管理Session的。 转自:tomcat架构分析 (Session管理) Tomcat中主要由每个context容器内的一个Manager对象来管理session。对于这个manager对 阅读全文
posted @ 2014-12-28 20:21 bingtel 阅读(275) 评论(0) 推荐(0)
摘要:A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2014-12-22 20:49 bingtel 阅读(161) 评论(0) 推荐(0)
摘要:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2014-12-22 18:39 bingtel 阅读(198) 评论(0) 推荐(0)
摘要:Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2014-12-22 18:34 bingtel 阅读(153) 评论(0) 推荐(0)
摘要:Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l... 阅读全文
posted @ 2014-12-17 18:51 bingtel 阅读(160) 评论(0) 推荐(0)
摘要:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2014-12-17 18:35 bingtel 阅读(299) 评论(0) 推荐(0)
摘要:转载:ubuntu搭建hadoop-Ver2.6.0完全分布式环境笔记自己在搭建hadoop平台时,碰到一些困难,按照该博文解决了问题,转载一下,作为记录。2 先决条件确保在你集群中的每个节点上都安装了所有必需软件:JDK ,ssh,Hadoop3 实验环境搭建3.1 准备工作操作系统:Ubuntu... 阅读全文
posted @ 2014-12-16 10:37 bingtel 阅读(215) 评论(0) 推荐(0)
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value t... 阅读全文
posted @ 2014-12-10 19:25 bingtel 阅读(128) 评论(0) 推荐(0)
摘要: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 阅读(143) 评论(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 阅读(447) 评论(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 阅读(425) 评论(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 阅读(127) 评论(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 阅读(138) 评论(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 阅读(205) 评论(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 阅读(179) 评论(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 阅读(135) 评论(0) 推荐(0)