deyes high school - questions · web viewq1. stacks and queues (a) in the context of data...

13
Contents Questions..........................................................2 Q1. Stacks and Queues............................................ 2 Q2 – Searching algorithms........................................3 Q3 – Data types.................................................. 4 Q4 – Control Structure........................................... 4 Q5 – Control Structure........................................... 4 Q6 – Control Structure........................................... 4 Q7 - Functions................................................... 4 Q8 - Variables................................................... 4 Q9 - Errors...................................................... 5 Q10 - Errors..................................................... 5 Q11 - Flowchart.................................................. 6 Q12 – Client/Server.............................................. 6 Q13 – Client/Server.............................................. 7 Mark Scheme........................................................7 M1. –Stacks and queues........................................... 7 M2. Searching algorithm..........................................7 M3 – Data Type................................................... 8 M4 – Control Structure........................................... 8 M5 – Control Structure........................................... 8 M6 – Control Structure........................................... 8 M7 - Functions................................................... 9 M8 - Variables................................................... 9 M9 - Errors...................................................... 9 M10 - Errors.................................................... 10 M11 - Flowchart................................................. 10 M12 – Client/Server............................................. 11 M13 – Client/Server............................................. 11

Upload: others

Post on 14-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

ContentsQuestions..............................................................................................................................................2

Q1. Stacks and Queues......................................................................................................................2

Q2 – Searching algorithms.................................................................................................................3

Q3 – Data types.................................................................................................................................4

Q4 – Control Structure.......................................................................................................................4

Q5 – Control Structure.......................................................................................................................4

Q6 – Control Structure.......................................................................................................................4

Q7 - Functions....................................................................................................................................4

Q8 - Variables....................................................................................................................................4

Q9 - Errors.........................................................................................................................................5

Q10 - Errors.......................................................................................................................................5

Q11 - Flowchart.................................................................................................................................6

Q12 – Client/Server...........................................................................................................................6

Q13 – Client/Server...........................................................................................................................7

Mark Scheme.........................................................................................................................................7

M1. –Stacks and queues....................................................................................................................7

M2. Searching algorithm...................................................................................................................7

M3 – Data Type.................................................................................................................................8

M4 – Control Structure......................................................................................................................8

M5 – Control Structure......................................................................................................................8

M6 – Control Structure......................................................................................................................8

M7 - Functions...................................................................................................................................9

M8 - Variables....................................................................................................................................9

M9 - Errors.........................................................................................................................................9

M10 - Errors.....................................................................................................................................10

M11 - Flowchart..............................................................................................................................10

M12 – Client/Server.........................................................................................................................11

M13 – Client/Server.........................................................................................................................11

Page 2: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

QuestionsQ1. Stacks and Queues

(a)     In the context of data structures what is meant by the terms:

(i)      FIFO; ....................................................................................................

(ii)     LIFO? ...................................................................................................(2)

(b)     Queue and stack are examples of data structures. Tick in the following table to indicate whether they are FIFO or LIFO data structures.

 

    FIFO LIFO

  Queue    

  Stack    

(2)

(c)     Describe one example of the use of a stack.

.......................................................................................................................

.......................................................................................................................

.......................................................................................................................(2)

Page 3: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

Q2 – Searching algorithmsA computer program stores a list of integers in an array named List. The numbers in the array are to be sorted into ascending order so that a particular efficient search algorithm can be used to search for a number.

(a)     One of the search algorithms in Table 1 can only be used successfully on a sorted list.

Place one tick next to the name of the algorithm that requires a list to be sorted.

Table 1 

  Algorithm NameRequires Sorted

List?(Tick one box)

  Binary search  

  Linear search  

(1)

Page 4: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

Q3 – Data types

Q4 – Control Structure

Q5 – Control Structure

Q6 – Control Structure

Q7 - Functions

Q8 - Variables

Page 5: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

Q9 - Errors

Q10 - Errors

Page 6: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

Q11 - Flowchart

Q12 – Client/Server

Page 7: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

Q13 – Client/Server

Mark Scheme

M1. –Stacks and queues(a)     (i)      First In First Out;

or by description

(ii)     Last In First Out;or by description

2

(b)    

    FIFO LIFO

  Queue  

  Stack  

2

(c)     Reverse the contents of a queue/list;Push all contents of queue/list onto stack then pop them off into a new queue/list;Procedure/function calls;Local variables;Parameters;Return Address;Volatile environment; A register contents State 1 Describe 1

2

M2. Searching algorithm(a)     

  Algorithm Name Requires SortedList? (Tick one box)

Page 8: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

  Binary search

  Linear search  

1 mark for having a tick in the "Binary search" row.A alternative indicators for tick eg "Yes"A a tick for "Binary search" and a cross for "Linear search"R answers where two ticks have been used.

M3 – Data Type1

M4 – Control Structure

M5 – Control Structure

M6 – Control Structure

Page 9: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

M7 - Functions

M8 - Variables

M9 - Errors

Page 10: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

M10 - Errors

M11 - Flowchart

Page 11: Deyes High School - Questions · Web viewQ1. Stacks and Queues (a) In the context of data structures what is meant by the terms: (i) FIFO; ..... A computer program stores a list of

M12 – Client/Server

M13 – Client/Server