Problem Description
bobo has a sequence a1,a2,…,an. He is allowed to swap two
adjacent numbers for no more than k times.
Find the minimum number of inversions after his swaps.
Note: The number...
分类:
其他好文 时间:
2014-08-05 22:44:03
阅读次数:
248
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:
其他好文 时间:
2014-08-05 22:35:00
阅读次数:
277
Note: For additional ORA-600 related information please read Note:146580.1PURPOSE: This article discusses the internal error "ORA-600 [729]", what ...
分类:
其他好文 时间:
2014-08-05 15:40:39
阅读次数:
237
题目:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space....
分类:
编程语言 时间:
2014-08-05 05:17:28
阅读次数:
265
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant ...
分类:
其他好文 时间:
2014-08-05 00:51:38
阅读次数:
249
Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree./** * Definiti...
分类:
其他好文 时间:
2014-08-05 00:01:38
阅读次数:
271
Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.class Solutio...
分类:
其他好文 时间:
2014-08-04 23:57:18
阅读次数:
476
题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-....
分类:
编程语言 时间:
2014-08-04 13:58:57
阅读次数:
285
很多安装软件会存储在USB硬盘里面,在Windows系统中,则意味着,该USB硬盘驱动必须使用NTFS格式,因为FAT32格式的最大文件大小是4GB。然而,这里又会碰到新问题,因为在RHEL5中,默认不支持NTFS格式,换一句话说,就不能挂载文件格式为NTFS的USB硬盘。不过这里有个权益之计(work around),被称作'ntfs-3g', 要使其生效,必须安装下面RPM包。
NOTE:
使用的版本必须和Linux kernerl module相匹配,可以用uname -r来查看kernel版本,第一...
分类:
其他好文 时间:
2014-08-03 23:23:46
阅读次数:
410
Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to us...
分类:
其他好文 时间:
2014-08-03 23:10:36
阅读次数:
179