上一页 1 ··· 8 9 10 11 12
摘要: Description 排序是一种很频繁的计算任务。现在考虑最多只有三值的排序问题。一个实际的例子是,当我们给某项竞赛的优胜者按金银铜牌序的时候。 在这个任务中可能的值只有三种1,2和3。我们用交换的方法把他排成升序的。 写一个程序计算出,给定的一个1,2,3组成的数字序列,排成升序所需的最少交换次 阅读全文
posted @ 2018-04-01 15:37 左手边五十米 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The wa 阅读全文
posted @ 2018-03-28 21:38 左手边五十米 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the 阅读全文
posted @ 2018-03-25 21:25 左手边五十米 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Description n children are standing in a circle and playing the counting-out game. Children are numbered clockwise from 1 to n. In the beginning, the 阅读全文
posted @ 2018-03-25 20:37 左手边五十米 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Problem Description 给一个初始的入栈序列,其次序即为元素的入栈次序,栈顶元素可以随时出栈,每个元素只能入栈依次。输入一个入栈序列,后面依次输入多个序列,请判断这些序列是否为所给入栈序列合法的出栈序列。 例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列 阅读全文
posted @ 2018-03-23 20:43 左手边五十米 阅读(381) 评论(0) 推荐(0) 编辑
摘要: Problem Description Fibonacci numbers are well-known as follow: Now given an integer N, please find out whether N can be represented as the sum of sev 阅读全文
posted @ 2018-03-22 23:12 左手边五十米 阅读(294) 评论(0) 推荐(0) 编辑
摘要: Problem Description: In computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite ful 阅读全文
posted @ 2018-03-22 22:59 左手边五十米 阅读(181) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12