WorksheetsPrinciples of Computational Thinking: Abstraction
Total questions: 64
Worksheet time: 11hrs 40mins
Which statement best describes abstraction in computing?
Removing unnecessary details to focus on key features
Breaking a problem into smaller parts for easy coding
Writing detailed algorithms for every program step
Collecting user data to customize application behavior
Which set lists the three main principles of computational thinking?
Abstraction, decomposition, algorithmic thinking
Virtualization, parallelism, caching
Iteration, recursion, data validation
Encapsulation, inheritance, polymorphism
Which is a real-world example of abstraction used in software?
A compiler exposing all machine registers
A database with every passenger’s biography
A map showing only routes and stations
A sensor reading raw signals without filtering
When developing a program, what should be identified to apply abstraction effectively?
User passwords stored in plain text files
Every technical detail of hardware drivers
All possible edge cases for future updates
Important features that contribute to the solution
The map shown uses a straight brown line with station names listed vertically. What feature has been abstracted to make the map easier to use?
Order of stations along the line
Station names and interchange icons
Accessibility information for stations
Exact street geography and distances
On the schematic map, why are interchange icons displayed next to some stations?
To display historical station facts
To mark stations with ticket barriers
To indicate connections to other lines
To show real-time train capacity
What is decomposition as described in the material?
Testing only the final combined program
Eliminating all features from a problem
Breaking a large problem into smaller problems
Combining tasks into one large process
Which statement best describes decomposition in computing?
Testing programs using multiple input data sets
Writing code with fewer lines for faster execution
Splitting a complex problem into manageable chunks
Translating pseudocode directly into a programming language
What is algorithmic thinking?
Choosing a language with built-in libraries
Drawing system diagrams before any coding
Remembering common code patterns for exams
Creating step-by-step instructions to solve problems
Which statement links abstraction and decomposition to algorithmic thinking?
They help identify each step before forming rules
They automatically generate working source code
They remove the need to plan test data
They make all solutions fully automated by default
Which everyday example illustrates algorithmic thinking leading to automation?
A gamer choosing difficulty in the menu
A human sketching game characters on paper
A set of traffic lights operating by fixed rules
A student buying components for a PC build
Which statement best describes a searching algorithm?
Random guesses to find data in a dataset
A visual chart used to store information
Shortcuts that always avoid comparisons
Exact step-by-step instructions for locating data
What key requirement must be true before running a binary search?
The data must be in order
The list must be very small
Numbers must be all even
All values must be unique
During binary search, what is compared at each step?
Target value with every value sequentially
All values with each other
First value with the last value
Target value with the middle value
If the target is smaller than the middle value in binary search, what should you do next?
Search the left half of the list
Search the right half of the list
Restart from the beginning
Swap the first and last values
Which option correctly lists two common searching algorithms?
Binary search and linear search
Depth-first and breadth-first
Insertion sort and quick sort
Bubble sort and merge sort
How does binary search operate on word datasets?
Ignores case and order entirely
Converts words to random numbers
Counts number of letters per word
Compares alphabetic order of words
Which step should happen first in a binary search process?
Identify the middle value
Remove duplicate entries
Pick a random starting index
Sort only the right half
In the example list [2, 5, 7, 12, 15, 22, 46], why does the search move left when looking for 7 after checking 12?
Because 12 is not in the list
Because 7 equals the middle value
Because 7 is smaller than 12
Because 7 is larger than 12
In the word example, the first middle value chosen from the list is which item?
Hip Hop
Techno
Rock
Jazz
After comparing 'Hip Hop' with target 'Rock', which half of the list should be kept?
Keep only the middle element
Keep entire list unchanged
Keep left half before Hip Hop
Keep right half after Hip Hop
Given the sublist [Jazz, Rock, Techno], what is the next middle element?
Techno
Jazz
Rock
Country
In Python, which expression correctly computes the middle index using low and high pointers?
mid = (high - low) // 2
mid = (low + high) // 2
mid = low + high
mid = (low + high) / 2
When data[mid] > target in the Python code, which pointer is updated and how?
high = high + 1
high = mid - 1
low = mid + 1
low = low - 1
What loop condition ensures the binary search continues while the search range is valid?
while high < low
while low < 0
while found is True
while low <= high
Which statement best describes a linear search on a list of values?
Uses a hash to jump directly to target
Sorts list first then compares adjacent values
Divides list in half and checks middle value
Starts at first item and checks each sequentially
When performing a linear search, what should you do immediately after checking the first value and it is not the target?
Check the last value immediately
Sort the dataset before continuing
Restart the search from the first value
Move to the next value and check it
Which dataset condition allows linear search but prevents binary search from working correctly?
Values are stored in a single array
Values contain duplicates in places
Values are all unique numbers
Values are unsorted or in random order
Which is an advantage of linear search compared to binary search?
Requires complex implementation steps
Guarantees constant-time searching
Always faster on huge datasets
Works on unsorted datasets reliably
Which is a disadvantage of linear search?
Cannot be implemented in Python
Fails on small datasets frequently
Requires data to be sorted first
Slow for large datasets overall
Binary search is typically faster than linear search for large datasets because it
Starts at the first index always
Checks every value sequentially
Halves the search space each step
Uses random indices for probing
In a Python linear search, which variable is commonly used to track whether the target was found?
A Boolean flag such as found
An integer counter named mid
A list storing checked indices
A string variable holding target
For repeated searches on the same large, sorted dataset, which algorithm is generally more efficient?
Binary search with ordered data
Linear search with random order
Linear search starting each time
Brute force with nested loops
Which statement best defines a sorting algorithm in computer science?
A method with precise step-by-step rules
A hardware technique for storing files
A visualization tool for datasets only
A random process that reorders data
What is the main action performed during bubble sort when two adjacent items are in the wrong order?
Swap the pair immediately
Skip the pair and continue
Insert a new placeholder
Delete the larger item
In bubble sort, what does one complete run from the start to the end of the list represent?
An insertion into the list
A single swap operation
The algorithm’s termination
A single pass through data
When does a bubble sort stop?
After exactly two passes
When the list is half sorted
When the first item is smallest
When no swaps occur in a pass
During a pass, which pairs are compared in bubble sort?
First and last only
Every third element
Pairs chosen randomly
Adjacent pairs left to right
Starting list: 5, 2, 4, 1, 6, 3. After the first comparison and necessary action, what does the list become?
2, 4, 5, 1, 6, 3
5, 2, 1, 4, 6, 3
5, 4, 2, 1, 6, 3
2, 5, 4, 1, 6, 3
In the same list, which comparison results in no swap during pass 1?
Comparing 5 and 6
Comparing 5 and 4
Comparing 2 and 1
Comparing 6 and 3
After completing pass 1 on 5, 2, 4, 1, 6, 3, which item is guaranteed to be in its final position?
The middle item unchanged
No item guaranteed fixed
The smallest item at the start
The largest item at the end
Which statement about repeating passes in bubble sort is correct?
Repeat until two items equal
Repeat a fixed number always
Repeat passes while swaps occur
Stop after first successful swap
A dataset of words must be sorted alphabetically. What determines swaps when comparing adjacent words?
Lexicographic order of strings
Vowel count in words
Position in the file
Length of each word
In the provided Python bubble sort, what is the role of the variable swaps within the while loop?
Holds the list length
Indexes the current pair
Controls loop continuation
Stores the largest value
Which line correctly performs a swap of two adjacent elements in the Python example?
swap(nums[y], nums[y+1])
temp = nums[y]; nums[y] = nums[y+1]; nums[y+1] = temp
nums[y] = nums[y+1] + temp
nums[y+1] = nums[y] and temp
Which best describes the divide step in merge sort?
Swap out-of-order neighboring values
Split dataset into halves recursively
Compare adjacent values repeatedly
Place each value into final position
During merging in merge sort, how are pairs of sub-datasets combined?
Concatenate lists without comparison
Add sums of corresponding elements
Randomly pick elements from each half
Compare first elements and append smaller
What is the main strategy behind merge sort?
Divide and conquer approach
Hash and distribute method
Greedy selection process
Backtracking exploration
After splitting into single-element sub-datasets, what happens next in merge sort?
Duplicates are removed automatically
Indices are reset to zero
Elements are shuffled randomly
Sub-datasets are merged in sorted order
Which sequence shows the final sorted output when merging 7, 4, 1, 2, 6, 3, 8, 5 using merge sort?
1, 3, 2, 4, 6, 5, 7, 8
7, 6, 5, 4, 3, 2, 1, 8
2, 1, 4, 3, 6, 5, 8, 7
1, 2, 3, 4, 5, 6, 7, 8
What repeats until one dataset remains in merge sort?
Merging pairs of sub-datasets
Calculating pivot positions
Swapping adjacent items
Selecting minimum from whole list
Why might an exam skip the divide stage and ask you only to demonstrate the conquer stage?
Conquer happens before divide stage
Divide can be pre-done to focus merging
Divide is not part of algorithm
Divide requires special hardware only
Which statement distinguishes merge sort from insertion sort in this material?
Merge sort merges sorted sublists; insertion places items
Merge sort swaps neighbors; insertion divides halves
Merge sort uses pivots; insertion concatenates lists
Merge sort randomizes order; insertion sorts by buckets
In insertion sort, what happens to the first element of the list at the start?
It is swapped with the smallest
It is discarded from the list
It is moved to the list’s end
It becomes the sorted sublist start
During insertion sort, which parts of the list are tracked while the algorithm runs?
A sorted left and unsorted right
Two unsorted halves only
Three rotating partitions
Only a temporary buffer
When comparing the next value to the sorted part in insertion sort, what occurs if it is smaller than the first sorted value?
Reverse the whole list
Swap the entire sublist
Duplicate the smaller value
Insert it to the left position
Which step is repeated in insertion sort until all values have been processed?
Compare then insert or keep
Delete then append values
Merge equal-sized blocks
Randomly shuffle elements
Given the list [54, 27, 17, 9, 40, 12], what is the list after inserting 27 into its correct position on the first pass?
[17, 27, 54, 9, 40, 12]
[54, 27, 17, 9, 40, 12]
[27, 54, 17, 9, 40, 12]
[27, 17, 54, 9, 40, 12]
Continuing insertion sort on [54, 27, 17, 9, 40, 12], what is the list after correctly placing 17?
[17, 27, 54, 9, 40, 12]
[17, 27, 9, 54, 40, 12]
[27, 17, 54, 9, 40, 12]
[17, 54, 27, 9, 40, 12]
After inserting 9 in the same process, what should the list look like?
[9, 17, 54, 27, 40, 12]
[9, 27, 17, 54, 40, 12]
[9, 17, 27, 40, 12, 54]
[9, 17, 27, 54, 40, 12]
Which statement best describes the goal of insertion sort for strings instead of numbers?
Order by string length only
Order by ASCII code only
Order by random character
Order alphabetically A to Z
In Python, which variable typically stores the number of items when starting insertion sort?
length = len(numbers)
total = sum(numbers)
count = size(numbers)
n = measure(numbers)
What does insertion sort do when the current item is not smaller than elements in the sorted sublist?
Delete and reinsert later
Move it to list front
Swap with the last element
Keep it in the same place
How do you feel about your knowledge about:
computational Thinking, Searching & Sorting and the concepts of abstraction, decomposition, algorithms, searching & sort?
I am still developing my knowledge of this topic.
I have a secure knowledge of this topic
I am confident about this topic.
I need to do more revision on this topic
