Difference between revisions of "2022 Paper 1 Revision Quiz"
(→Queues) |
|||
Line 119: | Line 119: | ||
{Complete the following; | {Complete the following; | ||
|type="{}"} | |type="{}"} | ||
− | A new item must be added to the { back|rear|tail | + | A new item must be added to the { back|rear|tail } of the queue. |
− | You must remove the item at the { front|head | + | You must remove the item at the { front|head } of the queue. |
</quiz> | </quiz> | ||
Line 322: | Line 322: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>C</td><td>{ None | + | <td>C</td><td>{ None }</td> |
</tr> | </tr> | ||
<tr> | <tr> | ||
− | <td>D</td><td>{ None | + | <td>D</td><td>{ None } </td> |
</tr> | </tr> | ||
</table> | </table> | ||
Line 331: | Line 331: | ||
{Complete the following | {Complete the following | ||
|type="{}"} | |type="{}"} | ||
− | You should use an adjacency list when there are { few | + | You should use an adjacency list when there are { few } edges. |
− | You should use an adjacency matrix if there are { many | + | You should use an adjacency matrix if there are { many } edges. |
{Processing adjacency matrix is much simpler because you can have direct access to check if an edge exists | {Processing adjacency matrix is much simpler because you can have direct access to check if an edge exists | ||
Line 435: | Line 435: | ||
|type="{}"} | |type="{}"} | ||
− | 1) Constant : { O(1 | + | 1) Constant : { O(1) } |
− | 2) { Logarithmic | + | 2) { Logarithmic } : O(log N) |
− | 3) Linear : { O(N | + | 3) Linear : { O(N) } |
− | 4) Linearithmic : { O(N log N) | + | 4) Linearithmic : { O(N log N) } |
− | 5) { Polynomial | + | 5) { Polynomial } : O (N<sup>2</sup>) |
− | 6) { Exponential | + | 6) { Exponential } : O(k<sup>N</sup>) |
− | 7) Factorial : { O(N!) | + | 7) Factorial : { O(N!) } |
{Complete the Order of Complexity for the following examples: | {Complete the Order of Complexity for the following examples: | ||
|type="{}"} | |type="{}"} | ||
− | 1) Finding the first item in a list : { O(1)|Constant | + | 1) Finding the first item in a list : { O(1)|Constant } |
− | 2) { Binary Search | + | 2) { Binary Search } : Logarithmic or O(log N) |
− | 3) { Linear Search | + | 3) { Linear Search } : Linear or O(N) |
− | 4) Merge Sort : { Linearithmic|O(N log N | + | 4) Merge Sort : { Linearithmic|O(N log N) } |
− | 5) { Bubble Sort | + | 5) { Bubble Sort } : Polynomial or O (N<sup>2</sup>) |
− | 6) { Chess Board Problem | + | 6) { Chess Board Problem } : Exponential or O(k<sup>N</sup>) |
− | 7) { Travelling Salesman Problem | + | 7) { Travelling Salesman Problem }: Factorial or O(N!) |
</quiz> | </quiz> | ||
Line 459: | Line 459: | ||
{Complete the Halting Problem: | {Complete the Halting Problem: | ||
|type="{}"} | |type="{}"} | ||
− | ‘Is it possible to { write|create | + | ‘Is it possible to { write|create } a program that can tell given any { program } and its { inputs } and without { executing } the program, whether it will { halt }?’ |
</quiz> | </quiz> |
Revision as of 10:22, 3 June 2022
Contents
Recursion
Arrays
Abstract Data Types & Dynamic vs Static
Queues
Stacks
Graphs
Trees
Graph Traversal
Searching Algorithms
Sorting Algorithms
Optimisation Algorithms
Order of Complexity