USE THIS SEARCH BOX AND GET MORE QUESTIONS UPDATES

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.

No comments:

Post a Comment