CS1080601a - Computer Science Foundation Exam August 6,...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science Foundation Exam August 6, 2001 Section I A No Calculators! Name: _______________________________ SSN: ________________________________ In this section of the exam, there are three (3) problems. You must do all of them. The weight of each problem in this section is indicated with the problem. The algorithms in this exam are written in a combination of pseudocode and programming language notation. Partial credit can not be given unless all work is shown. As always, be complete, yet concise, and above all be neat , credit can not be given when your results are unreadable. KEY
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1 (1, 20%) Given the following array of integers and algorithm, answer the questions below. Assume that the global array A[1. .n] is correctly declared and contains the values shown. Array A 1 4 2 5 8 6 position 1 2 3 4 5 6 algorithm P1 x, y, i, j, k : integer i 1 j 6 loop k i x A[i] y A[j] loop exitif (k > j) if(A[k] > x) then x A[k] endif if(A[k] < y) then y A[k] endif k k + 1 endloop
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

CS1080601a - Computer Science Foundation Exam August 6,...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online