Question

Question 5 (8 marks] We want to identify students who might need some help. These are defined as those students who have a co

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the algorithm below.

BEGIN:
INPUT : N:= NUMBER OF STUDENT IN THE CLASS
TAKE VARIABLE : ROLL_NUMBER[N];
TAKE VARIABLE : ARRAY[N] , COURSE_AVG[N],i=0;
FOOR LOOP: FOR i IN RANGE (0,N-1)
   IF (COURSE_AVG[i]>= 40 && COURSE_AVG[i]<= 60):
   ARRAY[i]=ROLL_NUMBER[i]
FOOR LOOP: FOR i IN RANGE (0,N-1)
PRINT ARRAY[i]
END;

Here , as the for loop will check for each student and the total number of student is n . Then for each studentit will take O(1) time . So , for n number of student the total time will be required : O(1)+O(1)+ .... n = O(n)

Add a comment
Know the answer?
Add Answer to:
Question 5 (8 marks] We want to identify students who might need some help. These are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT