activity question

387 views
Skip to first unread message

Bindu Yadav

unread,
Nov 2, 2020, 1:36:39 AM11/2/20
to Discussion forum for Computational Thinking
The current values are as follows:

max1 = 89, max2 = 78, max3 = 67

Let us assume that we always compare a new card first with max1, then with max2 and finally with max3. A new card is now picked up from Pile-1 that has the maths marks as 95.

1)How many pairwise comparisons among the variables and cards are needed to update all the variables? Note that each pair consists of a card and one of the three variables?
2)What will be the value of max1 + max2 + max3 after the update?
3)After making this update, another card comes up with 50 as the maths marks. How many pairwise comparisons are needed to update all variables? Note that each pair consists of a card and one of the three variables

Computational Thinking Support 2

unread,
Nov 2, 2020, 2:04:47 AM11/2/20
to Discussion forum for Computational Thinking, Bindu Yadav
Hi Bindu,
Can you try to solve above question by using attached pseudocode explained in the lecture 3.8 (slide no 8)?
If you are having still doubt let us know.

Regards,
Deepak
IITM Online Degree Team
Three_prize.png

Bindu Yadav

unread,
Nov 3, 2020, 1:55:37 AM11/3/20
to Computational Thinking Support 2, Discussion forum for Computational Thinking
Yes, I can. 

Reply all
Reply to author
Forward
0 new messages