adspace
Assume an array of structure is in order by studentID field
of the record, where student IDs go from 101 to 500. Write
the most efficient pseudocode algorithm you can to find the
record with a specific studentID if every single student ID
from 101 to 500 is used and the array has 400 elements.
Write the most efficient pseudocode algorithm you can to
find a record with a studentID near the end of the IDs, say
in the range from 450 to 500, if not every single student
ID in the range of 101 to 500 is used and the array size is
only 300
Answer Posted / Romesh Kumar Singh
[Pseudocode:ntfunction findNearEndStudentRecord(studentArray, startID, endID) {nttfor i from (N-1) down to 0 {ntttif (studentArray[i].studentID >= startID && studentArray[i].studentID <= endID) return studentArray[i];ntt}nttreturn null;n}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers