Assign 1 Data Struct PDF
Assign 1 Data Struct PDF
INSTRUCTIONS TO CANDIDATES:
Code in Python
No copying
Question 1
Write a code which sorts an array containing only 0's, 1's and 2's
INPUT { 0,1,2,2,1,0,0,2,0,1,1,0}
Question 2
a) Describe the major data structures used in the following areas: [6]
Describe the type of data structure that would be appropriate for this type of task. [5]
Question 3
Table 3
Output
Element at top of the stack: 9
Elements:
9
3
4
Stack full: false
Stack empty: true
Question 4