Advertisements
Advertisements
How is the state represented in algorithms?
Concept: undefined >> undefined
Distinguish between a condition and a statement.
Concept: undefined >> undefined
Advertisements
What is the difference between an algorithm and a program?
Concept: undefined >> undefined
For the given flowchart write the pseudo-code.

Concept: undefined >> undefined
For the given flowchart write the pseudo-code.

Concept: undefined >> undefined
If C is false in line 2, trace the control flow in this algorithm.
1 S1
2 -- C is false
3 if C
4 S2
5 else
6 S3
7 S4
Concept: undefined >> undefined
Draw a flowchart for -3 case analysis using alternative statements.
Concept: undefined >> undefined
Circulate the contents: Write the specification and construct an algorithm to circulate the contents of the variables A, B, and C as shown below: The arrows indicate that B gets the value of A, C gets the value of B and A gets the value of C.

Concept: undefined >> undefined
Trace the step-by-step execution of the algorithm for factorial(4).
factorial(n)
-- inputs : n is an integer , n ≥ 0
-- outputs : f = n!
f, i := 1 ,1
while i ≤ n
f, i := f × i, i+1
Concept: undefined >> undefined
If C is false just before the loop, the control flows through
1 S1
2 while C
3 S2
4 S3
Concept: undefined >> undefined
If C is true, S1 is executed in both the flowcharts, but S2 is executed in

(1)

(2)
Concept: undefined >> undefined
We wish to cover a chessboard with dominoes, `square``square` the number of black squares, and the number of white squares covered by dominoes, respectively, placing a domino can be modeled by ______
Concept: undefined >> undefined
If m x a + n x b is an invariant for the assignment a, b : = a + 8, b + 7, the values of m and n are ______
Concept: undefined >> undefined
Which of the following is not an invariant of the assignment?
m, n := m + 2, n + 3
Concept: undefined >> undefined
What is an invariant?
Concept: undefined >> undefined
There are 7 tumblers on a table, all standing upside down. You are allowed to turn any 2 tumblers simultaneously in one move. Is it possible to reach a situation when all the tumblers are right-side-up?
Concept: undefined >> undefined
A knockout tournament is a series of games. Two players compete in each game; the loser is knocked out (i.e. does not play anymore), the winner carries on. The winner of the tournament is the player that is left after all other players have been knocked out. Suppose there are 1234 players in a tournament. How many games are played before the tournament winner is decided?
Concept: undefined >> undefined
King Vikramaditya has two magic swords. With one, he can cut off 19 heads of a dragon, but after that, the dragon grows 13 heads. With the other sword, he can cut off 7 heads, but 22 new heads grow. If all heads are cut off, the dragon dies. If the dragon has originally 1000 heads, can it ever die?
Concept: undefined >> undefined
Assume an 8 × 8 chessboard with the usual coloring. "Recoloring" operation changes the color of all squares of a row or a column. You can recolor repeatedly. The goal is to attain just one black square. Show that you cannot achieve the goal.
Concept: undefined >> undefined
What is the difference between isupper() and toupper() functions?
Concept: undefined >> undefined
