# IBPS

Explore popular questions from Data Structure Compiler for IBPS. This collection covers Data Structure Compiler previous year IBPS questions hand picked by experienced teachers.

## Hindi Language

Data Structure Compiler

Correct Marks 1

Incorrectly Marks -0.25

Q 1. Two main measures for the efficiency of an algorithm are

A

Processor and memory

B

Complexity and capacity

Time and space

D

Data and space

E

None of these

##### Explanation

Time and space

Correct Marks 1

Incorrectly Marks -0.25

Q 2. The time factor when determining the efficiency of algorithm is measured by

A

Counting microseconds

Counting the number of key operations

C

Counting the number of statements

D

Counting the kilobytes of algorithm

E

None of these

Correct Marks 1

Incorrectly Marks -0.25

Q 3. The space factor when determining the efficiency of algorithm is measured by

Counting the maximum memory needed by the algorithm

B

Counting the minimum memory needed by the algorithm

C

Counting the average memory needed by the algorithm

D

Counting the maximum disk space needed by the algorithm

E

None of these

##### Explanation

Counting the maximum memory needed by the algorithm

Correct Marks 1

Incorrectly Marks -0.25

Q 4. Which of the following case does not exist in complexity theory

A

Best case

B

Worst case

C

Average case

Null case

E

None of these

##### Explanation

Null case

Correct Marks 1

Incorrectly Marks -0.25

Q 5. The Worst case occur in linear search algorithm when

A

Item is somewhere in the middle of the array

B

Item is not in the array at all

C

Item is the last element in the array

Item is the last element in the array or is not there at all

E

None of these

##### Explanation

Item is the last element in the array or is not there at all

Correct Marks 1

Incorrectly Marks -0.25

Q 6. The Average case occur in linear search algorithm

When Item is somewhere in the middle of the array

B

When Item is not in the array at all

C

When Item is the last element in the array

D

When Item is the last element in the array or is not there at all

E

None of these

##### Explanation

When Item is somewhere in the middle of the array

Correct Marks 1

Incorrectly Marks -0.25

Q 7. The complexity of linear search algorithm is

{tex}O(n){/tex}

B

{tex}O(log ){/tex}

C

{tex}O(n^2){/tex}

D

{tex}O(n log n){/tex}

E

None of these

##### Explanation

{tex}O(n){/tex}

Correct Marks 1

Incorrectly Marks -0.25

Q 8. The complexity of Binary search algorithm is

A

{tex}O(n){/tex}

{tex}O(log ){/tex}

C

{tex}O(n^2){/tex}

D

{tex}O(n log n){/tex}

E

None of these

##### Explanation

{tex}O(logn){/tex}

Correct Marks 1

Incorrectly Marks -0.25

Q 9. The complexity of Bubble sort algorithm is

A

{tex}O(n){/tex}

B

{tex}O(log n){/tex}

{tex}O(n^2){/tex}

D

{tex}O(n log n){/tex}

E

None of these

##### Explanation

{tex}O(n^2){/tex}

Correct Marks 1

Incorrectly Marks -0.25

Q 10. Each array declaration need not give, implicitly or explicitly, the information about

A

the name of array

B

the data type of array

the first data from the set to be stored

D

the index set of the array

E

None of these

Correct Marks 1

Incorrectly Marks -0.25

Q 11. If the sequence of operations - push(1), push(2), pop, push (1), push(2), pop, pop, pol , push(2), pop are preformed on a stack, the sequence of popped out values are ?

2, 2, 1, 1, 2

B

2, 2, 1, 2, 2

C

2, 1, 2, 2, 1

D

2, 1, 2, 2, 2

E

None of these

##### Explanation

The elements are popped from the top of the stack.

Correct Marks 1

Incorrectly Marks -0.25

Q 12. A machine needs a minimum of 100 sec to sort 1000 names by quick sort. The minimum time needed to sort 100 names will be approximately ?

A

50.2 sec

6.7 sec

C

72.7 sec

D

11.2 sec

E

None of these

##### Explanation

In the best case quick sort algorithm makes n log(n) comparisons so 1000 x log (1000) = 9000 comparisons, which takes 100 sec. To sort 100 names a minimum of 100 log (100) = 600 comparisons are needed . This takes 100 x 600/9000 = 6.7 sec.

Correct Marks 1

Incorrectly Marks -0.25

Q 13. The number of binary trees with 3 nodes which when traversed in post order gives the sequence A,B, C is ?

A

3

B

9

C

7

5

E

None of these

##### Explanation Correct Marks 1

Incorrectly Marks -0.25

Q 14. The average search time of hashing with linear probing will be less if the load factor ?

is far less than one

B

equals one

C

is far greater than one

D

All of the above

E

None of these

##### Explanation

Load factor is the ratio number of records that are currently present and the total number of records that can be present. If the load factor is less free space will be more. This means probability of collision is less. So the search time will be less.

Correct Marks 1

Incorrectly Marks -0.25

Q 15. A binary tree that has n leaf nodes. The number of nodes of degree 2 in this tree is ?

A

{tex}log_2n{/tex}

{tex}n - 1{/tex}

C

{tex}n{/tex}

D

{tex}2^n{/tex}

E

None of these

##### Explanation

It can be proved by induction that a binary tree with n leaf nodes will have total of {tex}2n - 1{/tex} nodes. So number of non-leaf nodes is {tex}(2n - 1)-n = n- 1{/tex}

Correct Marks 1

Incorrectly Marks -0.25

Q 16. As part of maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be ?

A

Bubble sort

Insertion sort

C

Selection sort

D

Heap sort

E

None of these

Correct Marks 1

Incorrectly Marks -0.25

Q 17. The way a card game player arranges his cards as he picks them up one by one, is an example of ?

A

bubble sort

B

selection sort

insertion sort

D

merge sort

E

None of these

##### Explanation

He scans throught the rest of the cards and pick the one with least value and places it next to the point till which he has already sorted the cards

Correct Marks 1

Incorrectly Marks -0.25

Q 18. Linked lists are suitable for which of the following problems?

A

Insertion sort

Binary search

C

Radix sort

D

Polynomial manipulation

E

None of these

##### Explanation

Through Linked list binary search can be performed efficiently.

Correct Marks 1

Incorrectly Marks -0.25

Q 19. The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?

Finite state automata

B

Deterministic push down automata

C

Non-deterministic push down automata

D

Turing machine

E

None of these

##### Explanation

Finite state automata.

Correct Marks 1

Incorrectly Marks -0.25

Q 20. In a compiler, keyboards of a language are recognized during

A

parsing of the program

B

the code generation

the lexical analysis of the program

D

data flow analysis

E

None of these

##### Explanation

the lexical analysis of program.

Correct Marks 1

Incorrectly Marks -0.25

Q 21. Which data structure in a compiler is used for managing information about variables and their attributes?

A

Abstract syntax-tree

Symbol table

C

Semantic stack

D

Parser table

E

None of these

##### Explanation

Symbol table is a data structure in a compiler. It was devised for the purpose that it can be used to manage information about variable and their attributes. Example Symbol table. Correct Marks 1

Incorrectly Marks -0.25

Q 22. Some code optimizations are carried out on the intermediate code because

A

they enhance the portability of the compiler to other target processors

B

program analysis is more accurate on intermediate code than on machine code

C

the information from data flow analysis cannot be used for optimization

the information from the front end cannot be used for optimization

E

None of these

##### Explanation

Code optimizations are generally carried out on intermediate code. This is done to convert the source code to the machine language of the target machine on the basis of back end tools. It enhances the portability of the compilers to the other target processors.

Correct Marks 1

Incorrectly Marks -0.25

Q 23. Which of the following are true?
1. A programming language which does not permit global variables of any kind and has no nesting of procedures/ functions, but permits recursive can be implemented with static storage allocation
2. Multi-level access link (or display) arrangement is needed to arrange activation records only, if the programming language being implemented has nesting of procedures/functions.
3. Recursion in programming languages cannot be implemented with dynamic storage allocation
4. Nesting of procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with a stack-based allocation scheme for activation records.
5. Programming languages which permit a function to return a function as its result cannot be implemented with a stack based storage allocation scheme for activation records

A

2 and 5

B

1, 3 and 4

C

1, 2 and 5

2, 3 and 5

E

None of these

##### Explanation

Statement 1 True: A programming language which does not permit global variables of any kind has no nesting of procedures/fimctions, but permits recursion can be implemented with static storage allocation.
Statement 2 False: It is not necessary to have nesting of procedures/function in the programming language being implemented when activation records are arranged using multi level access link.
Statement 3 True: Recursion in programming language cannot be implemented with dynamic storage allocation.
Statement 4 : False Nesting of procedures/fimctions and recursion can be implemented with a stack based allocation scheme for activation.
Statement 5 True:The programming languages which permit a function to return a function as its result cannot be implemented with a stack based storage allocation scheme for activation records.