Skip to content
Yunhan's Lab
Go back

系统设计题目总结

Edit page

Reductions and Partitioned Reductions

0.
f[0..100) is an array of int, determine the largest value in the middle 40 elements of f. 1. Construct a program to compute the product of the natural numbers from 12 to 98. 2. Construct a program to count the number of single digit values in the array f[0..N) of int. 3. Construct a program to count the vowels in an array f[0..2000) of char.

Search Algorithms

Given f[0..200) of integer, determine whether all the values in f are odd. 2. Given f[100..200) of integer, determine whether the final 10 elements are an exact copy of the first 10 elements. 3. Given f[0..N) of integer, determine whether it is sorted in ascending order. 4. Given f[0..100) of integer, find the location of the largest element in f. 5. Given f[0..1000) of character, determine whether the word “cat” appears in f.

The Binary Chop

Given f[0..1000] of int, We are told that f.0 and f.N have opposite parity. Construct an efficient program to find an index i within f where f.i and f.(i+1) have opposite parity. 2. Given f[0..N] of int which doesn’t contain any zeros, we are told that f.0 and f.N are of opposite sign. Construct a program to find a location i within f where f.i and f.(i-1) are of opposite sign. Note that we say 2 numbers are the same sign if they are both positive to both negative and opposite sign if one is positive and the other is negative.

Recursively defined functions

Segment sums and products

Single element property Segment problems

找单一属性的最长片段

”Almost” property segments

与上面类似,“几乎”单一属性的最长片段

Pair element property segment problems

组合属性的最长片段

”Almost” pair element property segments

与上面类似,“几乎”组合属性的最长片段


Edit page
Share this post on:

Previous Post
Fusc-like 6步走
Next Post
Comp3030J参考视频