Thursday, August 20, 2009

TWO MARKS QUESTIONS AND ANSWERS

DATA STRUCTURES



Previous Next

11. Define Worst case of an algorithm?
It is the longest time that an algorithm will use over all instances of size n for a
given problem to produce the result.


12. Define Best case of an algorithm?
It is the shortest time that an algorithm will use over all instances of size n for
a given problem to produce the result.


13. Define average case an algorithm?
It is the average time that an algorithm will use over all instances of size n for
a given problem to produce the result.


14. Define Divide and Conquer algorithm?
Divide and Conquer algorithm is based on dividing the problem to be solved
into several, smaller sub instances, solving them independently and then combining
the sub instances solutions so as to yield a solution for the original instance.


15. Mention some application of Divide and Conquer algorithm?
a. Quick Sort
b. Merge Sort
c. Binary search


16. Define dynamic programming algorithm?
Dynamic programming algorithm is a general class of algorithms which solve
problems by solving smaller versions of the problem, saving the solutions to the
small problems and then combining them to solve the larger problems.


17. Mention application of dynamic programming algorithm?
Efficient Fibonocci number computation
Chained matrix multiplication.
Longest common subsequence problem


18. State the various steps in algorithm?
Devising the algorithm
Validating the algorithm
Expressing the algorithm
Determination of complexity of the algorithm


19. Define algorithm paradigms space of an algorithm?
Algorithmic paradigms are defined as the general approach to design and construct efficient solutions to problems.


20. Mention the various spaces utilized by a program?
a. A fixed amount of memory occupied by the space for the program code and space occupied by the variables used in the program.
b. A variable amount of memory occupied by the variable whose size is dependent on the problem being solved. This space increases or decreases depending upon whether the program uses iterative or recursive procedures.

Previous Next

No comments:

Post a Comment