Determine whether an integer is a palindrome. Do this without extra space.解题思路:由于题目中给定不能使用额外空间开销,因此不能转为String类型,我们需要一位一位处理。Java代码如下: static public boo...
分类:
编程语言 时间:
2015-04-26 10:42:59
阅读次数:
131
快速排序 1 public class QuickSort{ 2 3 public static int Partition(int[] a,int low,int high){ 4 int pivotkey=a[low]; 5 while(low=...
分类:
编程语言 时间:
2015-04-26 01:13:39
阅读次数:
141
问题描述:Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are t...
分类:
编程语言 时间:
2015-04-25 14:54:15
阅读次数:
167
取出重复的客运车班次SELECT CID, FROM_CITY, TO_CITY, TICKET_PRICE FROM CITYWHERE CID IN (SELECT DISTINCT FIRST_VALUE(CCID) OVER(PARTITION BY FROM_CITY, TO_CITY O...
分类:
其他好文 时间:
2015-04-25 00:06:41
阅读次数:
125
Time Limit:15000MSMemory Limit:65536KTotal Submissions:5121Accepted:1834DescriptionAndy the smart computer science student was attending an algori...
分类:
其他好文 时间:
2015-04-24 12:06:40
阅读次数:
134
统计前半个回文串
#include
using namespace std;
#define For(i,n) for(int i=1;i=k;i--)
#define Rep(i,n) for(int i=0;i<...
分类:
其他好文 时间:
2015-04-23 13:24:32
阅读次数:
143
Reducer任务的数据来自于Mapper任务,也就说Mapper任务要划分数据,对于不同的数据分配给不同的Reducer任务运行。Mapper任务划分数据的过程就称作Partition。负责实现划分数据的类称作Partitioner。默认的分区类是HashPartitioner,是处理Mapper...
分类:
其他好文 时间:
2015-04-23 10:48:22
阅读次数:
112
1 #include "stdafx.h" 2 #include "stdlib.h" 3 4 int Partition(int *arr,int _low,int _high); 5 void QSort(int *arr,int low,int high); 6 void QuickSor.....
分类:
编程语言 时间:
2015-04-22 22:00:25
阅读次数:
161
关于network partition
网络设备故障导致的网络分裂。比如,存在A\B\C\D\E五个节点,A\B处于同一子网,B\C\D处于另外一子网,中间通过交换机相连。若两个子网间的交换机故障了即发生了网络分区,A\B和C\D\E便不能通讯。
某些系统是partition-tolerant的,也即,即使发生了网络分区系统分裂为了多个子系统,整个系统仍能正常工作。
RabbitMQ...
分类:
其他好文 时间:
2015-04-22 18:10:36
阅读次数:
133
分布式领域CAP理论, Consistency(一致性), 数据一致更新,所有数据变动都是同步的 Availability(可用性), 好的响应性能 Partition tolerance(分区容错性) 可靠性 定理:任何分布式系统只可同时满足二点,没法三者...
分类:
其他好文 时间:
2015-04-22 11:54:43
阅读次数:
143