Difference between revisions of "2022 Paper 1 Revision Quiz"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Queues)
Line 266: Line 266:
 
   </tr>
 
   </tr>
 
     <tr>
 
     <tr>
     <td>C</td><td>{ None }</td>
+
     <td>C</td><td>{ None (i) }</td>
 
   </tr>
 
   </tr>
 
     <tr>
 
     <tr>
     <td>D</td><td>{ None } </td>
+
     <td>D</td><td>{ None (i) } </td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 430: Line 430:
 
|type="{}"}
 
|type="{}"}
  
1) Constant        : { O(1) }
+
1) Constant        : { O(1) (i) }
2) { Logarithmic } : O(log N)
+
2) { Logarithmic (i)} : O(log N)
3) Linear          : { O(N) }
+
3) Linear          : { O(N) (i) }
4) Linearithmic    : { O(N log N) }
+
4) Linearithmic    : { O(N log N) (i) }
5) { Polynomial }  : O (N<sup>2</sup>)
+
5) { Polynomial (i) }  : O (N<sup>2</sup>)
6) { Exponential } : O(k<sup>N</sup>)   
+
6) { Exponential (i) } : O(k<sup>N</sup>)   
7) Factorial      : { O(N!) }
+
7) Factorial      : { O(N!) (i) }
  
 
{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 (i) }
2) { Binary Search } : Logarithmic or O(log N)  
+
2) { Binary Search (i) } : Logarithmic or O(log N)  
3) { Linear Search } :  Linear or O(N)  
+
3) { Linear Search (i) } :  Linear or O(N)  
4) Merge Sort        : { Linearithmic|O(N log N) }
+
4) Merge Sort        : { Linearithmic|O(N log N) (i) }
5) { Bubble Sort }  : Polynomial or O (N<sup>2</sup>)
+
5) { Bubble Sort (i) }  : Polynomial or O (N<sup>2</sup>)
6) { Chess Board Problem } : Exponential or O(k<sup>N</sup>)   
+
6) { Chess Board Problem (i) } : Exponential or O(k<sup>N</sup>)   
7) { Travelling Salesman Problem }: Factorial or O(N!)  
+
7) { Travelling Salesman Problem (i)  }: Factorial or O(N!)  
 
</quiz>
 
</quiz>
  
Line 454: Line 454:
 
{Complete the Halting Problem:
 
{Complete the Halting Problem:
 
|type="{}"}
 
|type="{}"}
  ‘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 }?’
+
  ‘Is it possible to { write|create (i) } a program that can tell given any { program (i) } and its { inputs (i)  } and without { executing (i) } the program, whether it will { halt (i) }?’
 
</quiz>
 
</quiz>

Revision as of 10:10, 3 June 2022

Recursion

1. In Recursion, the part of the code which runs itself is called?

General Case.
Correct
Base Case.
Incorrect
Repeating Case.
Incorrect
Recursive Case.
Incorrect

2. In Recursion, the condition which stops the recursive calls is called?

General Case.
Correct
Base Case.
Incorrect
Repeating Case.
Incorrect
Recursive Case.
Incorrect

3. Look at this sample code:

1: public int Fact(int num)
2: {
3:   if (num == 0)
4:       return 1;
5:   else
6:       return num * Fact(num-1);
7: }

Which of these lines are the General Case?

3
Incorrect
4
Incorrect
5
Incorrect
6
Correct

4. Look at this sample code:

1: public int Fact(int num)
2: {
3:   if (num == 0)
4:       return 1;
5:   else
6:       return num * Fact(num-1);
7: }

Which of these lines are the Base Case?

3
Almost, this is the condition which causes the base case
4
Correct
5
Incorrect
6
Incorrect

5. Look at this sample code:

 1: public int Fact(int num)
 2: {
 3:   if (num == 0)
 4:       return 1;
 5:   else
 6:       return num * Fact(num-1);
 7: }

The function Fact is run with the parameter of 5.

Fact(5);
What is the return value for the First call:
What is the return value for the Second call:
What is the return value for the Third call:
What is the return value for the Fourth call:
What is the return value for the Fifth call:
What is the return value for the Sixth call:
What will be the final value returned for the call Fact(5):

Your score is 0 / 0


Arrays

Your score is 0 / 0


Abstract Data Types & Dynamic vs Static

Your score is 0 / 0


Queues

1. A queue is ?

Last In First Out .
Incorrect
First in First Out.
Correct

2. Look at this graph:

Graph-4.jpg

select the appropriate options below:

The degree of vertex A is 3
Incorrect
The degree of vertex D is 1
Incorrect
The degree of vertex B is 3
Correct
The degree of vertex E is 1
Correct

3. Look at this graph:

Graph-4.jpg

select the appropriate options below:

Directed
Incorrect
Undirected
Correct
Weighted
Incorrect
Unweighted
Correct

4. Look at this graph:

Graph1.png

select the appropriate options below:

Directed
Incorrect
Undirected
Correct
Weighted
Correct
Unweighted
Incorrect

5. Look at this graph:

Graph2.png

select the appropriate options below:

Directed
Correct
Undirected
Incorrect
Weighted
Incorrect
Unweighted
Correct

6. Look at this graph:

Graph3.png

Complete the adjacency matrix, use Y & N only:

0123
0X
1 X
2X
3 X

7. Look at this graph:

Graph2.png

Complete the adjacency matrix, use Y & N only:

ABCD
AX
B X
CX
D X

8. Look at this graph:

Graph3.png

Complete the adjacency list (separate with commas & no spaces):

Connected
0
1
2
3

9. Look at this graph:

Graph2.png

Complete the adjacency list (separate with comma no spaces, use None if nothing is connected):

Connected
A
B
C
D

10. Complete the following

You should use an adjacency list when there are edges.
You should use an adjacency matrix if there are edges.

11. Processing adjacency matrix is much simpler because you can have direct access to check if an edge exists

True
Correct
False
Incorrect

Your score is 0 / 0


Stacks

1. A stack is ?

Last In First Out .
Correct
First in First Out.
Incorrect

2. The stack pointer will point to?

The location to store the next item
Incorrect
Top of the stack.
Correct
Bottom of the stack.
Incorrect

3. To add an item to the stack you?

Pop.
Incorrect
Push.
Correct
Peek.
Incorrect

4. To remove an item from the stack you?

Pop.
Correct
Push.
Incorrect
Peek.
Incorrect

5. To look at the top of the stack without removing it you?

Pop.
Incorrect
Push.
Incorrect
Peek.
Correct

Your score is 0 / 0


Graphs

Your score is 0 / 0


Trees

1. Which of the following must a graph have to also be a tree?

Not Connected
Incorrect
Connected.
Correct
Weighted
Incorrect
Unweighted.
Incorrect
Directed.
Incorrect
Undirected.
Incorrect
With Cycles
Incorrect
Without Cycles
Correct

Your score is 0 / 0


Graph Traversal

Your score is 0 / 0


Searching Algorithms

Your score is 0 / 0


Sorting Algorithms

1. Which sorting algorithm uses 'Divide & Conquer' strategy?

Bubble Sort.
Incorrect
Merge Sort.
Correct
Neither.
Incorrect

2. Which sorting algorithm will complete a number of passes?

Bubble Sort.
Correct
Merge Sort.
Incorrect
Neither.
Incorrect

3. Which sorting algorithm will break a list into multiple lists containing a single value?

Bubble Sort.
Incorrect
Merge Sort.
Correct
Neither.
Incorrect

4. Which sorting algorithm will be recursive?

Bubble Sort.
Incorrect
Merge Sort.
Correct
Neither.
Incorrect

5. Which sorting algorithm will sort the list with N-12 comparisons?

Bubble Sort.
Correct
Merge Sort.
Incorrect
Neither.
Incorrect

Your score is 0 / 0


Optimisation Algorithms

Your score is 0 / 0


Order of Complexity

1. Complete the following:

1) Constant  :
2) { Logarithmic (i)} : O(log N)
3) Linear  :
4) Linearithmic  :
5)  : O (N2)
6)  : O(kN)
7) Factorial  :

2. Complete the Order of Complexity for the following examples:

1) Finding the first item in a list  :
2)  : Logarithmic or O(log N)
3)  : Linear or O(N)
4) Merge Sort  :
5)  : Polynomial or O (N2)
6)  : Exponential or O(kN)
7) : Factorial or O(N!)

Your score is 0 / 0


Halting Problem

1. Complete the Halting Problem:

‘Is it possible to a program that can tell given any and its and without the program, whether it will ?’

Your score is 0 / 0