Comprehesion-type questions
Learning
Outcomes:
- Represent algorithms with flowcharts or block diagrams.
- Apply algorithms of counting, accumulating, swapping, searching, sorting and merging in writing programs.
- The search algorithms included are linear search and binary search.
- Construct lists, stacks and queues in terms of arrays.
- Students should be able to create and manipulate linear linked lists, stacks and queues in terms of arrays.
- Realise the importance of good programming styles.
- Students should develop the habit of using meaningful variable names, comments, annotations, space and indentation.
- Design sets of test data for program testing.
- Test data for boundary cases has been discussed in the Compulsory Part.
Follow a flowchart
Relevant past paper:
DSE ICT Elect B(SP-2017):
2014 1b.
Searching
Linear/sequential
search: check the items one by one. E.g. for data structure such as queue and
linked list.
Binary search: for data sorted
in an array.
Relevant past paper:
DSE ICT Elect B(SP-2017):
2017 4dii,e.
Linked lists, stacks, queues
- Linked lists: need to find an item by linear search. More flexible to add or remove an item.
- Queues: first-in-first-out. Need to use head and tail indicator.
- Stacks: last-in-first-out.
All data structure can have underflow errors/overflow errors
if attempts to add items to a full list or to remove items from empty list.
Relevant past paper:
DSE ICT Elect B(SP-2017):
SP 2de. PP 2ab. 2012 2a. 2014 1ci,3. 2016 2ac. 2017 3ab.
CE CIT Elect A(2005-2011): 2005 4. 2006 4. 2008 2ab. 2009
3abce. 2010 1a. 2011 3a-d.
Good programming
styles
- Use of meaningful variable names, comments, annotations, space and indentation.
- Use of constant: easy to change the value for use in other programs.
Relevant past paper:
DSE ICT Elect B(SP-2017):
2012 3b.
Test
data
Useful set
of test data should include:
- Valid data: normal data and extreme case
- Invalid data
Relevant past paper:
DSE ICT Elect B(SP-2017):
PP 3e. 2013 2e.
CE CIT Elect A(2005-2011): 2006 1c.
Manipulate arrays
Relevant past paper:
DSE ICT Elect B(SP-2017):
2014 2abci. 2015 3abii,iii.
Other questions
Relevant past paper:
DSE ICT Elect B(SP-2017):
SP 2a. 2013 4ab. 2015 4bc. 2016 3avd. 2017 4aci,di.
No comments:
Post a Comment