Save
Computer Science Paper 1
4.3 Fundamentals Of Algorithms
Searching Algorithms
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Samuel Olaleye
Visit profile
Cards (16)
What is an algorithm?
A set of
instructions
to complete a task
View source
What is the primary task of a searching algorithm?
To find the location of an
item
in a
list
View source
Name 2 types of searching algorithm.
Linear and Binary search
View source
What is the time complexity of a linear search?
O(N)
View source
On what type of list can a linear search be conducted?
Any
unordered list
View source
What are the steps in a linear search algorithm?
Compare each item
sequentially
Check if it matches the
target
Continue until found or
end of list
View source
Why is using a For...Next loop in a linear search considered bad practice?
It uses
definite iteration
instead of
indefinite
View source
What is the time complexity of both Do Until and For...Next loops in a linear search?
O(N)
View source
What is the time complexity of a binary search?
O(logN)
View source
What is a binary tree?
An a cyclic connected graph
View source
How does a binary tree search differ from a binary search?
It is conducted on a
binary tree
View source
What is the time complexity of a binary tree search?
O(logN)
View source
What are the steps in a binary tree search?
Start at the
root
Compare target with
node
Traverse
left
or
right
based on comparison
View source
What are the characteristics of a binary tree?
Acyclic
Connected graph
Each
node
has 0, 1, or 2
children
View source
What are the steps to conduct a binary search on an array?
Sort
the array
Find the
midpoint
Compare target with midpoint
Discard
half of the array
Repeat until found or empty
View source
How do binary searches compare to linear searches in terms of speed?
Binary
searches are much faster than
linear
searches
View source