返回卡包市场

Chapter 7 Algorithm Design And Problem Solving: Unit 7.4: Standard Methods Of Solution

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 6内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (6 张)

#1
正面 (问题)

What are the 5 standard methods of solution?

背面 (解答)

Totalling Counting Finding the max, min and average (mean) values Searching using a linear search Sorting using a bubble sort

#2
正面 (问题)

Describe totalling.

背面 (解答)

Keeping a total that values are added to. Example: Total <– 0 FOR Counter <– 1 TO ClassSize Total <– Total + StudentMark[Counter] NEXT Counter

#3
正面 (问题)

Describe counting.

背面 (解答)

Keeping a count of the number of times an action is performed. Example: PassCount <– 0 FOR Counter <– 1 TO ClassSize INPUT StudentMark IF StudentMark > 50 THEN PassCount <– PassCount + 1 NEXT Counter Count <– Count + 1 Can also be used to count down.

#4
正面 (问题)

Describe finding the max, min and average (mean) values.

背面 (解答)

Finding the largest and smallest values in a list. Example: MaximumMark <– 0 MinimumMark <– 100 FOR Counter <– 1 TO ClassSize IF StudentMark[Counter] > MaximumMark THEN MaximumMark <– StudentMark[Counter] ENDIF IF StudentMark[Counter] < MinimumMark THEN MinimumMark <– StudentMark[Counter] ENDIF NEXT Counter Calculating the average (mean) of all values in a list is an extension of the totalling method. Example: Total <– 0 FOR Counter <– 1 TO ClassSize Total <– Total + StudentMark[Counter] NEXT Counter Average <– Total / ClassSize

#5
正面 (问题)

Describe linear search.

背面 (解答)

A search is used to check if a value is stored in a list, performed by systematically working through the items in the list. Linear search inspects each item in a list in turn to see if the item matches the value searched for. Example: OUTPUT “Please enter name to find “ INPUT Name Found <– FALSE Counter <– 1 REPEAT IF Name = StudentName[Counter] THEN Found <– TRUE ELSE Counter <– Counter + 1 ENDIF UNTIL Found OR Counter > ClassSize IF Found THEN OUTPUT Name, “ found at position “, Counter, “ in the list.” ELSE OUTPUT Name, “ not found.” ENDIF

#6
正面 (问题)

Describe bubble sort.

背面 (解答)

Each element is compared with the next element and swapped if the elements are in the wrong order, starting from the first element and finishing with the next-to-last element. Example: First <– 1 Last <– 10 REPEAT Swap <– FALSE FOR Index <– First TO Last - 1 IF Temperature[Index] > Temperature[Index + 1] THEN Temp <– Temperature[Index] Temperature[Index] <– Temperature[Index + 1] Temperature[Index + 1] <– Temp Swap <– TRUE ENDIF NEXT Index Last <– Last - 1 UNTIL (NOT Swap) OR Last = 1