C949 DATA STRUCTURES AND ALGORITHMS | FROM
QUESTION TO PERFECTION| STUDY WITH CONFIDENCE!
Course Code:
Course Title:
Programme:
Academic Year: 2026/2027
Duration: 2 Hours.
Total Marks: 70%.
Candidate Instructions:
1) Write your Registration Number on every answer booklet used.
2) Answer ALL questions in Section A and ANY TWO (2) questions in Section B.
3) Read each question carefully before answering.
4) Begin each question on a new page.
5) The marks for each question are indicated in brackets.
6) This paper consists of several printed pages, including this page.
7) Ensure your copy is complete before the examination begins.
8) Unauthorized materials and communication with other candidates are not permitted.
Turn Over.
APPHIA – Crafted with Care and Precision for Academic Excellence.
1
, Tuple Answer: A datatype that is immutable, which means that once it's been created, the
elements can't be changed. It is also a sequence type. Is typically used when element position,
and not just the relative ordering of elements is important.
Named Tuple Answer: An immutable datatype where the element position is important. Each
element can have it's own designated name.
Set Answer: An ADT that serves as an unordered collection of unique elements. When created,
the values should be contained within a sequence-type iterateable object.
Intersection Answer: Returns a new set containing only the elements in common between one
set and all provided sets.
Union Answer: Returns a new set containing all of the unique elements in all sets.
Difference Answer: Returns a set containing only the elements of set that are not found in any
of the provided sets.
Symmetric Difference Answer: Returns a set containing only elements that appear in exactly
one of set A or set B.
Dictionary Answer: A python container used to describe associative relationships. It associates
keys with values. A key can be any immutable type, such as a number, string, or tuple. A value
can be any type.
Numeric Data Type Answer: A data type which supports all of the normal mathematical
operations. These are the most common types used to store data.
Sequence Data Type Answer: Data types which are collections of objects ordered by position.
Mapping Data Type Answer: A data type used exclusively by the dict type. Each element is
independent, which means there is no special ordering. Also uses key value pairs to associate a
key with a value.
Algorithm Answer: A sequence of steps for accomplishing a task.
Linear Search Answer: A search algorithm that starts from the beginning of a list and checks
each element until the search key is found or the end of the list is reached.
Runtime Answer: The time it takes for an algorithm to execute.
Binary Search Answer: An algorithm for searching a list if the list's elements are sorted. It starts
by checking the middle element of the list. If the search key is found, the algorithm returns the
matching location. If not, the algorithm repeats the search on the remaining left sublist if the
search key is less than the middle element, or on the remaining right sublist if it's larger.
[log2N]+1 Answer: The maximum number of steps required to reduce the search space to an
empty sublist.
APPHIA – Crafted with Care and Precision for Academic Excellence.
2
QUESTION TO PERFECTION| STUDY WITH CONFIDENCE!
Course Code:
Course Title:
Programme:
Academic Year: 2026/2027
Duration: 2 Hours.
Total Marks: 70%.
Candidate Instructions:
1) Write your Registration Number on every answer booklet used.
2) Answer ALL questions in Section A and ANY TWO (2) questions in Section B.
3) Read each question carefully before answering.
4) Begin each question on a new page.
5) The marks for each question are indicated in brackets.
6) This paper consists of several printed pages, including this page.
7) Ensure your copy is complete before the examination begins.
8) Unauthorized materials and communication with other candidates are not permitted.
Turn Over.
APPHIA – Crafted with Care and Precision for Academic Excellence.
1
, Tuple Answer: A datatype that is immutable, which means that once it's been created, the
elements can't be changed. It is also a sequence type. Is typically used when element position,
and not just the relative ordering of elements is important.
Named Tuple Answer: An immutable datatype where the element position is important. Each
element can have it's own designated name.
Set Answer: An ADT that serves as an unordered collection of unique elements. When created,
the values should be contained within a sequence-type iterateable object.
Intersection Answer: Returns a new set containing only the elements in common between one
set and all provided sets.
Union Answer: Returns a new set containing all of the unique elements in all sets.
Difference Answer: Returns a set containing only the elements of set that are not found in any
of the provided sets.
Symmetric Difference Answer: Returns a set containing only elements that appear in exactly
one of set A or set B.
Dictionary Answer: A python container used to describe associative relationships. It associates
keys with values. A key can be any immutable type, such as a number, string, or tuple. A value
can be any type.
Numeric Data Type Answer: A data type which supports all of the normal mathematical
operations. These are the most common types used to store data.
Sequence Data Type Answer: Data types which are collections of objects ordered by position.
Mapping Data Type Answer: A data type used exclusively by the dict type. Each element is
independent, which means there is no special ordering. Also uses key value pairs to associate a
key with a value.
Algorithm Answer: A sequence of steps for accomplishing a task.
Linear Search Answer: A search algorithm that starts from the beginning of a list and checks
each element until the search key is found or the end of the list is reached.
Runtime Answer: The time it takes for an algorithm to execute.
Binary Search Answer: An algorithm for searching a list if the list's elements are sorted. It starts
by checking the middle element of the list. If the search key is found, the algorithm returns the
matching location. If not, the algorithm repeats the search on the remaining left sublist if the
search key is less than the middle element, or on the remaining right sublist if it's larger.
[log2N]+1 Answer: The maximum number of steps required to reduce the search space to an
empty sublist.
APPHIA – Crafted with Care and Precision for Academic Excellence.
2