摘要: 算法想了一阵,不过因为数据量本身不大,还是很容易A的。1.整体qsort一遍,放另外一个数组里面,如果数字所在位置和排序后相同,则称为已定位2.从未定位stack中找最大值3.把最大值翻到top-stack,如果在top-stack就跳过4.从未定位的位置开始整体翻过来5.最大值已定位,重复2题目: Stacks of FlapjacksStacks of FlapjacksBackgroundStacks and Queues are often considered the bread and butter of datastructures and find use in archite 阅读全文
posted @ 2013-02-10 23:25 上白泽慧音 阅读(1754) 评论(0) 推荐(0) 编辑
摘要: 简单的冒泡排序,这题是练英语阅读的。题目:Train SwappingTrain SwappingAt an old railway station, you may still encounter one of the last remaining ``train swappers''. A train swapper is an employee of the railroad, whose sole job it is to rearrange the carriages of trains.Once the carriages are arranged in the o 阅读全文
posted @ 2013-02-10 17:21 上白泽慧音 阅读(355) 评论(0) 推荐(0) 编辑