摘要:
剑指Offer - 九度1504 - 把数组排成最小的数2014-02-06 00:19题目描述:输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。输入:输入可能包含多个测试样例。对于每个测试案例,输入的第一行为一个整数m (1 4 #include 5 #include 6 #include 7 using namespace std; 8 9 vector vv;10 int n;11 12 bool comparator(const string &x, 阅读全文
posted @ 2014-02-06 00:28
zhuli19901106
阅读(357)
评论(0)
推荐(0)
摘要:
剑指Offer - 九度1503 - 二叉搜索树与双向链表2014-02-05 23:39题目描述:输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表。要求不能创建任何新的结点,只能调整树中结点指针的指向。输入:输入可能包含多个测试样例。对于每个测试案例,输入的第一行为一个数n(0 5 #include 6 #include 7 using namespace std; 8 9 typedef struct st{ 10 public: 11 int key; 12 struct st *ll; 13 struct st *rr; 14 ... 阅读全文
posted @ 2014-02-06 00:09
zhuli19901106
阅读(281)
评论(0)
推荐(0)


浙公网安备 33010602011771号