Page 1 of 1

Q3 Answer Q3(a)-Q3(c) based on the information given in Figure Q3. int myAlgo2 (int n[], int size, int key) \{ int i; fo

Posted: Tue Jul 12, 2022 8:28 am
by answerhappygod
Q3 Answer Q3 A Q3 C Based On The Information Given In Figure Q3 Int Myalgo2 Int N Int Size Int Key Int I Fo 1
Q3 Answer Q3 A Q3 C Based On The Information Given In Figure Q3 Int Myalgo2 Int N Int Size Int Key Int I Fo 1 (70.32 KiB) Viewed 36 times
Q3 Answer Q3(a)-Q3(c) based on the information given in Figure Q3.
int myAlgo2 (int n[], int size, int key) \{ int i; for (i=0;i<size;++i) \{ if (n==key){ return i; \} \} return -1; Figure Q3 (a) Write the output of the program. (2 marks) (b) Name the algorithm for Algol (). (1 mark) (c) Name the algorithm for Algo2(). (1 mark) (d) Which algorithm is more appropriate to search an item from the array in Figure Q3? Justify your answer. (4 marks)