Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the...

40
Abstract Data Structures Table of Contents ABSTRACT DATA STRUCTURES 1 OLD SYLLABUS (06-14) 1 NEW SYLLABUS 2 OLD SYLLABUS QUESTIONS 5 NEW SYLLABUS QUESTIONS 25 Old Syllabus (06-14) 5.1.2 Define stack, queue and binary tree. 5.1.3 Discuss the features and appropriate usage of stacks including: parameter storage, interrupt handling, evaluation of arithmetic expressions and storage of subprogram return addresses. 5.1.4 Discuss the features and appropriate usage of queues including: keyboard queues, print queues and customer queue simulations. 5.1.5 Discuss the features and appropriate usage of binary trees including: storing search keys, decision trees and file systems. 5.2.4 Trace algorithms that implement a stack in an array. 5.2.5 Construct algorithms that implement a stack in an array. 5.2.6 Trace algorithms that implement a queue in an array. 5.2.7 Construct algorithms that implement a queue in an array. 5.3.1 Define object reference. Aryan Bhasin

Transcript of Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the...

Page 1: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Abstract Data Structures

Table of Contents

ABSTRACT DATA STRUCTURES 1

OLD SYLLABUS (06-14) 1

NEW SYLLABUS 2

OLD SYLLABUS QUESTIONS 5

NEW SYLLABUS QUESTIONS 25

Old Syllabus (06-14)5.1.2 Define stack, queue and binary tree. 5.1.3 Discuss the features and appropriate usage of stacks including: parameter storage,

interrupt handling, evaluation of arithmetic expressions and storage of subprogram return addresses.

5.1.4 Discuss the features and appropriate usage of queues including: keyboard queues, print queues and customer queue simulations.

5.1.5 Discuss the features and appropriate usage of binary trees including: storing search keys, decision trees and file systems.

5.2.4  Trace algorithms that implement a stack in an array.

5.2.5  Construct algorithms that implement a stack in an array.

5.2.6  Trace algorithms that implement a queue in an array.

5.2.7  Construct algorithms that implement a queue in an array.

5.3.1 Define object reference.

5.3.2 Construct algorithms that use reference mechanisms.

5.3.3 Discuss the features and appropriate usage of single, double and

circular linked lists.

5.3.4 Outline and illustrate how links operate logically.

5.3.5 Trace algorithms to implement linked lists.

5.3.7 Trace algorithms that implement a dynamic stack using references. Aryan Bhasin

Page 2: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

5.3.8 Construct algorithms that implement a dynamic stack using references.

5.3.9 Trace algorithms that implement a dynamic queue using references.

5.3.10 Construct algorithms that implement a dynamic queue using references.

5.3.11 Define parent, left-child, right-child and subtree.

5.3.12 Trace algorithms to implement binary trees.

5.3.14 Outline and illustrate the logical representation of dynamic data structures.

5.5.1 Define recursion.

5.5.2 Discuss the advantages and disadvantages of recursion.

5.5.3 Trace recursive algorithms

5.5.4 Construct recursive algorithms

5.6.1 State the efficiency of the following algorithms in BigO notation: a linear search is O(n), a bubble sort is O(n2), a quicksort is O(n log n), a binary search is O(log n) and a selection sort is O(n2), given a randomly distributed data set

5.6.2 Analyse the efficiency of algorithms (those in 5.6.1 and those of similar complexity), in terms of BigO notation and in terms of the storage requirements.

5.6.3 Outline how data structures in this syllabus can be organized to suit the requirements of applications.

- Students should consider the needs of different applications for data types and data structures. For example, stacks might be used to track changes to a word processing document whereas a queue might store data items being entered at the keyboard for subsequent processing in the order in which they arrived. Ordered binary trees and hash tables are frequently used to store key fields used for quick retrieval of items from an unordered data file.

5.6.4 Evaluate algorithms that use any of the data structures in this syllabus.

New Syllabus

Assessment statement Obj Teacher’s notes

Thinking recursively

5.1.1 Identify a situation that requires the use of recursive thinking. 2

Suggested practical activity: snowflakes and fractals, towers of Hanoi.

Aryan Bhasin

Page 3: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

5.1.2 Identify recursive thinking in a specified problem solution. 2 LINK Binary trees.

5.1.3 Trace a recursive algorithm to express a solution to a problem. 2

Students will be required to state the output of the recursive algorithm. For example, trees.

LINK Binary trees.

Abstract data structures

5.1.4 Describe the characteristics of a two- dimensional array. 2 LINK One-dimensional arrays and

basic algorithms.

5.1.5 Construct algorithms using two- dimensional arrays. 3 LINK Pseudocode information.

5.1.6 Describe the characteristics and applications of a stack. 2

Characteristics:

Last in, first out (LIFO).

Examples of the applications of stacks may include running recursive processes, return memory addresses.

LINK Recursive thinking; connecting computational thinking and program design.

5.1.7 Construct algorithms using the access methods of a stack. 3

Access methods:

 push

 pop

 isEmpty. LINK Connecting computational thinking and program design.

5.1.8 Describe the characteristics and applications of a queue.

2 Characteristics:

First in, first out (FIFO).

Examples of the applications of queues may include print queues and the computer modelling of physical queues (eg supermarket checkouts).

Aryan Bhasin

Page 4: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Both linear and circular implementation of a queue are required.

LINK Connecting computational thinking and program design.

5.1.9 Construct algorithms using the access methods of a queue. 3

Access methods:

 enqueue

 dequeue

 isEmpty. LINK Connecting computational thinking and program design.

5.1.10 Explain the use of arrays as static stacks and queues. 3

Students should be able to explain push and pop operations, and test on empty/full stack.

Students should be able to explain enqueue and dequeue operations, and test on empty/full queue.

Linked lists

Linked lists will be examined at the level of diagrams and descriptions. Students are not expected to construct linked list algorithms using pseudocode.

5.1.11 Describe the features and characteristics of a dynamic data structure.

2 Students should understand the concepts of nodes and pointer.

5.1.12 Describe how linked lists operate logically. 2 LINK Logical thinking.

5.1.13 Sketch linked lists (single, double and circular). 3

Students should be able to sketch diagrams illustrating: adding a data item to linked list, deleting specified data item, modifying the data held in the linked list, searching for a given data item.

Trees

Binary trees will be examined at the level of diagrams and descriptions. Students are not expected to construct tree algorithms using pseudocode.

Aryan Bhasin

Page 5: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Tracing and constructing algorithms are not expected.

5.1.14 Describe how trees operate logically (both binary and non-binary). 2 LINK Recursive thinking.

5.1.15 Define the terms: parent, left-child, right-child, subtree, root and leaf. 1 These definitions only apply to a

binary tree.

5.1.16 State the result of inorder, postorder and preorder tree traversal. 1

5.1.17 Sketch binary trees. 3

Students should be able to sketch diagrams showing the resulting binary tree after adding a new data item, adding one or more new nodes, and/or removing one or more nodes.

Applications

5.1.18 Define the term dynamic data structure. 1

5.1.19 Compare the use of static and dynamic data structures. 3 LINK One-dimensional arrays.

5.1.20 Suggest a suitable structure for a given situation. 3

Old Syllabus Questions

Aryan Bhasin

Page 6: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 7: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 8: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 9: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

[ADD MAY 2008]

Aryan Bhasin

Page 10: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 11: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 12: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

(a) Define stack. (b) State two applications of stacks in computing.

Aryan Bhasin

Page 13: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 14: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 15: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 16: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 17: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 18: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 19: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 20: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 21: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 22: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 23: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 24: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 25: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 26: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 27: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

New Syllabus Questions (does not include Section B with Topic 4 sub-parts)

Refer to Topic 4 Question Compilation for Abstract Data Structure sub parts

Aryan Bhasin

Page 28: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 29: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 30: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 31: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 32: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 33: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 34: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 35: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 36: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 37: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin

Page 38: Abstract Data Structures - aryanbhasin.com  · Web viewFirst in, first out (FIFO). Examples of the applications of queues may include print queues and the computer modelling of physical

Aryan Bhasin