题意:又是回文判断:该数是否是回文数原题来自:https://leetcode.com/problems/palindrome-number/分析:回文真多,直接把数反转来判断是否相等。 1 class Solution { 2 public: 3 bool isPalindrome(int...
分类:
其他好文 时间:
2015-06-18 21:42:04
阅读次数:
114
范围分区:CREATETABLEBIGTABLE(IDINT,SNPTIMEDATETIMENOTNULL,VALUEVARCHAR(20),PRIMARYKEY(SNPTIME,ID))ENGINE=InnoDBpartitionbyrange(TO_DAYS(SNPTIME))(PARTITIONp1VALUESLESSTHAN(to_days(‘2009-1-31‘)),PARTITIONp2VALUESLESSTHAN(to_days(‘2009-2-28‘)),PARTITIONp3VAL..
分类:
数据库 时间:
2015-06-18 20:16:11
阅读次数:
142
题目意思:判断是否为回文数,不许使用额外空间 ps:一直不理解额外空间的意思,int能用吗思路:1.比较头尾 2.翻转,越界问题需考虑 1 class Solution { 2 public: 3 bool isPalindrome(int x) { 4 if(x...
分类:
其他好文 时间:
2015-06-18 19:04:49
阅读次数:
96
Partition为分割算法,用于将一个序列a[n]分为三部分:a[n]中大于某一元素x的部分,等于x的部分和小于x的部分。Partition程序如下:long Partition (long a[], long p1, long p2){//对a[p1]~a[p2]进行分割,返回分割点的序号, p...
分类:
其他好文 时间:
2015-06-18 18:57:46
阅读次数:
94
题目
Determine whether an integer is a palindrome. Do this without extra space.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to...
分类:
其他好文 时间:
2015-06-18 17:22:44
阅读次数:
87
fdisk -l 查看硬盘信息df -h查看文件系统使用量fdisk /dev/sdb处理硬盘,删除分区,新建分区之类partprobe将核心的 partition table 更新mkfs -t ext4 /dev/sdb1vi /etc/fstab (设置开机自动挂载)/dev/mapper/v...
分类:
其他好文 时间:
2015-06-18 15:05:38
阅读次数:
121
语法:ROW_NUMBER() OVER(PARTITION BY COLUMN ORDER BY COLUMN) 简单的说row_number()从1开始,为每一条分组记录返回一个数字,这里的ROW_NUMBER() OVER (ORDER BY xlh DESC) 是先把xlh列降序,再为...
分类:
数据库 时间:
2015-06-18 14:59:01
阅读次数:
148
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-06-18 11:43:55
阅读次数:
109
hive中支持两种类型的分区:静态分区SP(static partition),动态分区DP(dynamic partition)
静态分区与动态分区的主要区别在于静态分区是手动指定,而动态分区是通过数据来进行判断。详细来说,静态分区的列实在编译时期,通过用户传递来决定的;动态分区只有在SQL执行时才能决定。...
分类:
其他好文 时间:
2015-06-18 09:52:50
阅读次数:
212
1Palindrome Partitioning问题来源:Palindrome Partitioning该问题简单来说就是给定一个字符串,将字符串分成多个部分,满足每一部分都是回文串,请输出所有可能的情况。 该问题的难度比较大,很可能第一次遇到没有思路,这很正常。下面我们一点点分析,逐步理清思路。先...
分类:
编程语言 时间:
2015-06-17 23:04:56
阅读次数:
208