USE THIS SEARCH BOX AND GET MORE QUESTIONS UPDATES

Showing posts with label Programming and data structures questions and answers. Show all posts
Showing posts with label Programming and data structures questions and answers. Show all posts

Saturday, September 3, 2016

Programming and data structures

1.In the runtime environment, the languages that necessarily need heap allocation is
The one that use global variables The one that allow dynamic data structures The one that support recursion The one that use dynamic scoping

2.What is the requirement for evaluating an expression without any embedded function calls?
Two stack One stack In general case a turning machine is needed As many stacks as the height of an expression tree

3.What is the advantage of chained hash table (external hashing) over open addressing scheme?
Easier deletion is possible Less space is required Worst case complexity of search operations is less None of the above

4.The process in which load addresses are assigned to various parts of the program and to reflect the assigned addresses, code and date in a program are adjusted is called
Relocation Symbol resolution Parsing Assembly

5.Why there are security concerns in case of dynamic linking?
Because cryptographic procedures are not available for dynamic linking. Because security is dynamic Because linking is not secured Because the path for searching dynamic libraries is not known till runtime.

Friday, August 19, 2016

Programming and data structures

1.Which one of the following statement is true for Abstract Data type (ADT)?
It is same as an abstract class It is a data type for which only the operations defined on it can be used but none else It is the data type that cannot be instantiated None of the above.

2.Consider a binary tree that is initially empty. The numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in a binary tree in that order. The binary search tree uses the usual ordering on natural numbers. The in-order traversal sequence of the resultant tree will be
7 6 5 4 8 9 0 1 2 3 1 9 2 7 3 8 5 6 0 4 0 1 2 3 4 5 6 7 8 9 0 3 2 5 6 4 8 1 9 7

3.Faster access to non-local variables is achieved using an array of pointers to activation records called a
Activation tree Stack Heap None of the above

4.The programming language feature that cannot be implemented on a certain processor, which supports only immediate and the direct addressing modes is
Pointers Records Arrays Recursive procedures with local variables

Saturday, August 6, 2016

Programming and data structures questions and answers

1.Consider a two dimensional array of integers arr[1…. 10][1…. 15]. One memory location is occupied by each integer. The first element of array is stored at location 100 and the array is stored in row-major order. The address of the element arr[i][j] is
15j + i + 84 15i + j + 84 21i + j + 93 21j + I + 93

2.Assuming that the height of a tree with a single node is 0, the maximum height of any AVL-tree with 7 nodes is
5 4 3 2

3.Consider an empty binary search tree into which the following numbers are inserted in the given order: 10,1, 3, 5, 15, 12, 16. The height of the maximum distance of a leaf node from the root is
2 4 3 8

4.Linked list are not suitable data structures of _________________
Binary search Insertion sort Polynomial manipulation Radix sort

5.For efficiently converting an infix expression to the post fix form, use
A parse tree An operand stack An operator stack Both an operator and an operand stack

Friday, July 29, 2016

Programming and data structures questions and answers

1.Consider a program that reads 500 integers in the range of [0, 100] that represents the score of 500 students. Frequency of each score above 50 is then printed. For the program to store the frequencies the best way is
A dynamically allocated array of 550 numbers An array of 100 numbers An array of 500 numbers An array of 50 numbers

2.What is the goal of structured programming?
Able to infer the flow of control from the program text Able to infer the flow of control from the Compiled code To avoid the use of GOTO statements None of the above

3.To check whether an arithmetic expression has balanced parenthesis, the best data structure that can be used is
Stack Tree List Queue

4.Consider a stack S of size n ≥ 1 which is initially empty. In an empty stack first n natural numbers are pushed in sequence and then n pop operations are performed. Push and pop operations take x seconds each. The time elapse between the end of one stack operation and the start of the next operation is y. For m ≥ 1, define the stack-life of m as the time elapsed from the end of push (m) to the start of the pop operation that removes m from stack S. What is the average stack-life of an element of this stack?
3y + 2x n (x + y) - x n (x + y) y + 2x

5.The logic programming languages and functional languages have the common properties that
Both use Horn-clauses Both are declarative Both are procedural languages Both are based on -calculus.