QUE. What is the data structures used to perform recursion?
Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.
QUE. What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms?
Polish and Reverse Polish notations.
QUE. Convert the expression ((A + B) * C – (D – E) ^ (F + G)) to equivalent Prefix and Postfix notations.
Prefix Notation:
^ - * +ABC - DE + FG
^ - * +ABC - DE + FG
Postfix Notation:
AB + C * DE - - FG + ^
AB + C * DE - - FG + ^
QUE - Sorting is not possible by using which of the following methods?
(a) Insertion
(b) Selection
(c) Exchange
(d) Deletion
(d) Deletion.
Using insertion we can perform insertion sort, using selection we can perform selection sort, using exchange we can perform the bubble sort (and other similar sorting methods). But no sorting method can be done just using deletion.
***Long time back these questions were read from one website about placements and I had all these questions noted down in a Notepad. I just copied whole content, so that it can be helpful for relevant folks.
No comments:
Post a Comment