Professional Documents
Culture Documents
Dr Stephen Swift Click to edit Master subtitle style 16.1 Exam Revision
Introduction
This lecture is a revision lecture for the exam for this module nThe exam is on Tuesday 10th May at 2pm nIn this lecture we are going to cover:
n
The assessment nThe format of the exam nExam topics nSome example questions
n
2Slide 2
50% Coursework (done) n10% Laboratory work sheets (done) n40% Exam (pending)
n
3Slide 3
Exam
n
The location should now be available A multiple choice part A worth 40% An essay-type question part B worth 60%
However you may need to understand and/or write some pseudo code
n
CS2004 Exam Revision 5Slide 5
Algorithmic concepts
n
What is an algorithm, a program, etc T(n) and O(n) Stacks, lists, arrays, queues, etc Bubblesort, Quicksort, etc
Data structures
n
Sorting Algorithms
n
6Slide 6
Depth First, Breadth First, A*, MST, etc Search, Search Space, Fitness, Parameter optimisation, etc... HC, SHC, RRHC, SA, ILS, etc... Genetic Algorithms, PSO, ACO, etc... Bin Packing, Data Clustering, TSP, etc...
Search
n
Applications
n
7Slide 7
Choose an answer from a list of options n20 questions of 2 marks each nSpend about 2 minutes per question nUse the multiple choice answer sheet
n
8Slide 8
Read through all of the questions first nAnswer the ones that you know first nDo NOT spend too much time on a single question nOften ruling out answers can reduce the options down to a few nDo not leave any blank!
n
9Slide 9
10Slide 10
Read through all of the questions first nAnswer the ones that you know first nDo NOT spend too much time on a single question nSketching a draft answer can help in laying out complex answers nCross out anything you do not want marked
n
11Slide 11
a) A Java program nb) A programming language independent description of an algorithm nc) The intermediate code produced by the Java compiler nd) An algorithmic description of a computer program ne) None of the above CS2004 Exam Revision 12Slide 12
a) Algorithm B is always faster than C nb) Algorithm A and C are the same nc) Algorithm A is slower than Algorithm B nd) Algorithm A and C are asymptotically similar in performance ne) None of the above
n
13Slide 13
a) A stack nb) A queue nc) An array nd) A linked list ne) It depends on the application
n
14Slide 14
15Slide 15
a) No time it is already sorted nb) O(n) nc) O(nln(n)) nd) O(n2) ne) It depends on the algorithm
n
16Slide 16
17Slide 17
a) Random Restart Hill Climbing nb) Stochastic Hill Climbing nc) Genetic Algorithm nd) Hill Climbing ne) Simulated Annealing
n
18Slide 18
a) Bin packing is slower than data clustering nb) Bin packing is used on small sized objects whilst data clustering is used on large objects nc) Both algorithms arrange objects into groups nd) Bin packing is used on 1-dimensional data whilst data clustering can be used on ndimensional data ne) They perform the same function
n
19Slide 19
Algorithm 1. MaxArray(A) Input: An n row by m column Array A 1) Let max = element 1,1 (A(1,1)) of Array A 2) For i = 1 to n 3) For j = 1 to m 4) If A(i,j) > max Then 5) Let max = A(i,j) 6) End If 7) End For 8) End For Output: max- the largest element in array A CS2004 Exam Revision 20Slide 20
Algorithm 1. MaxArray(A) Input: An n row by m column Array A 1) Let max = element 1,1 (A(1,1)) of Array A 2 2) For i = 1 to n n 3) 4) 5) 6) For j = 1 to m n (m) If A(i,j) > max Then n m (5) [Assume worse] Let max = A(i,j) n m (4) End If none 23Slide 23
O(n) = nm nTo create algorithm MinArray nWe change the > on line 4 to a < nWe would also rename the algorithm name and results variable CS2004 Exam Revision 24Slide 24
n
Next Topic
There is none! nHopefully see you next year nGood luck! nAny questions
n
25Slide 25