摘要: 插入和冒泡的排序都写完了,现在再来搞一下选择排序喽。 选则排序其实很简单,同样分成已排序部分和未排序部分。 就只是不断的从未排序部分里将最小值或最大值选出,让他与未排序部分的第一个元素交换位置,重复操作。 举个例子: A = {5,4,8,7,9,3,1}; 1.{5,4,8,7,9,3,1}; | 阅读全文
posted @ 2016-12-21 11:30 fengsz 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Stack Aizu - ALDS1_3_A Write a program which reads an expression in the Reverse Polish notation and prints the computational result. An expression in 阅读全文
posted @ 2016-12-21 11:27 fengsz 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Queue Aizu - ALDS1_3_B For example, we have the following queue with the quantum of 100ms. A(150) - B(80) - C(200) - D(200) First, process A is handle 阅读全文
posted @ 2016-12-21 11:24 fengsz 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Doubly Linked List Aizu - ALDS1_3_C Your task is to implement a double linked list. Write a program which performs the following operations: insert x: 阅读全文
posted @ 2016-12-21 11:21 fengsz 阅读(305) 评论(0) 推荐(0) 编辑
摘要: Areas on the Cross-Section Diagram Aizu - ALDS1_3_D Areas on the Cross-Section Diagram 地域の治水対策として、洪水の被害状況をシミュレーションで仮想してみよう。 図のように $1 \times 1 (m^2)$ の 阅读全文
posted @ 2016-12-21 11:17 fengsz 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Linear Search You are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of intege 阅读全文
posted @ 2016-12-21 11:13 fengsz 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Binary Search You are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of intege 阅读全文
posted @ 2016-12-21 11:07 fengsz 阅读(243) 评论(0) 推荐(0) 编辑