Input
The input consists of a single line, which contains a string of Latin alphabet letters (no other characters will appear in the string). String length will not exceed 1000 characters.
Outpu...
分类:
编程语言 时间:
2015-03-19 22:09:51
阅读次数:
176
1 public class QuickSortTest{ 2 //比较与交换 3 private static int partition(int[] source, int low, int hight) { 4 int key = source[low]; 5...
分类:
编程语言 时间:
2015-03-19 18:12:43
阅读次数:
175
原课程计划里并没有这篇内容,今天在群里讨论SSAS的负载均衡方案,有网友提到Remote Partition远程分区,恕我孤陋寡闻,之前未曾了解过这个解决方案,阅读了官方的文档后觉得这个的确很有益处,这里记录下Demo实践的过程供大家参考,并特此鸣谢方案的提出者"理想"同学,很多时候真的是没有做不到...
分类:
其他好文 时间:
2015-03-18 17:53:30
阅读次数:
227
非递归:
#include
#include
int partition(int s[], int i, int j)
{
int value = 0;
int flag = 1; //判断该从头循环还是尾循环
value = s[i];
while(i<j)
{
switch(flag)
{
case 0:
if(s[i] < value)
i++;
...
分类:
编程语言 时间:
2015-03-18 12:26:19
阅读次数:
130
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan...
分类:
其他好文 时间:
2015-03-18 12:07:14
阅读次数:
111
problem:
Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of conv...
分类:
其他好文 时间:
2015-03-17 22:00:59
阅读次数:
163
??
《剑指Offer》P163
题目:找出数组中一个出现次数超过整个数组长度一般的数字
解法一:将原问题转化为求数组的中位数,采用快速排序的思想,每一次Partition取末位为哨兵,遍历将小于、大于哨兵的数分别移至哨兵左右,最后返回哨兵在处理后的数组中的位置。不断缩小要处理的数组的长度大小,最终确定返回值为数组长度一半的元素,即为中位数。
解法二:由...
分类:
编程语言 时间:
2015-03-17 10:33:19
阅读次数:
159
Kafka中Replicas复制备份机制 kafka将每个partition数据复制到多个server上,任何一个partition有一个leader和多个follower(可以没有),备份的个数可以通过broker配置文件来设定(replication-factor的参数配置指定).leader处...
分类:
其他好文 时间:
2015-03-16 22:45:56
阅读次数:
302
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in each of...
分类:
其他好文 时间:
2015-03-16 17:55:05
阅读次数:
105
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A
man, a plan, a canal: Panama" is a palindrome.
"race
a car" is no...
分类:
其他好文 时间:
2015-03-16 17:48:39
阅读次数:
117