functions (3.papers)

loops (1.papers)

Conditional statements (2.papers)

arrays (2.papers)

structures (3.papers)

unions (1.papers)

Enums and TypeDefs (3.papers)

pointers (7.papers)

null pointers (1.papers)

strings (2.papers)

misc c concepts (1.papers)

Data structures (5.papers)

linked lists (3.papers)

trees (1.papers)

basics (5.papers)

bitwise operators (1.papers)

1

stack push and pop in c: If you push the numbers (in order) 1, 3 and 5 onto a stack, which pops out first?

1

3

5

it depends

Show Answer

2

which of the below is not a data structure in c? i. array ii. string iii. structure iv. linked list

none of them are data structure

all of them are data structures

linked list is not a data structure

string is not a data structure

Show Answer

3

what is a stack in c data structures? i. It is a data structure, which holds and emits data items in First In First Out order. ii. It is a data structure, which holds and emits data items in Last In First Out Order.

i

ii

it is up to us. we can use Stack for both option i or option ii

option ii is true, and we have to implement stack using only arrays.

Show Answer

Show Answer

Show Answer

Show Answer

7

What is a stack in c?

Stack data structure is based on Last In First Out approach

Stack data structure is based on First In First Out approach

Stack can follow either Last In First Out or First In First Out approach.

option 3 is true, but not always

Show Answer

8

What is a Queue in c?

Queue data structure is based on Last In First Out approach

Queue data structure is based on First In First Out approach

Queue can follow either Last In First Out or First In First Out approach.

option 3 is true, but not always

Show Answer

Show Answer

Show Answer

11

Which of the below data structures can be used to build the Stack in c? i. Array ii. Linked list iii. binary tree

i

ii

i or ii

i or ii or iii

Show Answer

12

Which of the below are correct functions of a Stack in c? i. enqueue() ii. push() iii. pop() iv. dequeue()

i

ii

ii & iii

i & iv

Show Answer

13

which of the below options are true about a stack operations in c? i. push function will insert new element at the end ii. pop function will remove the element from last.

i

ii

i & ii

option i is right, but option ii pop removes the first element not last.

Show Answer

14

which of the below options are true about a stack?

push() operates at the first element of the list, and pop operates at the end of the list.

push() operates at the last element of the list, and pop also operates at the end of the list.

push() operates at the end element of the list, and pop operates at the first element of the list.

push() operates at the first element of the list, and pop also operates at the first element of the list.

Show Answer

15

Which of the below are examples of Stack? i. papers kept in a printer tray ii. pile of books in a library iii. finding binary equivalent of a decimal number

i

i & ii

i, ii & iii

i & iii

Show Answer

16

Which of the below are not examples of Stack? i. towers of hanoi ii. Evaluation of fully parenthesized infix expression. iii. pile of plates in a hotel.

i

ii

ii & iii

none

Show Answer

17

JVM (Java Virtual Machine) follows which architecture?

JVM follows stack based architecture.

JVM follows queue based architecture

JVM follows both stack and queue based architecture

none

Show Answer

Show Answer

Show Answer

20

What operation below function doing? And which data structure is this? #define MAX_ELE 10 //assume maximum elements is 10 int cur; //points to top element. void fun(int ds[], int item) { if (cur == (MAX_ELE - 1)) printf("overflow..can't insert") else { ++cur; ds [cur] = item; } }

this function is trying to insert a new element into the array ds[]. here ds is an array data structure.

this function is trying to insert a new element on top location of this data structure. So this is a stack.

this function is trying to insert a new element on top location of this data structure. So this is a queue.

both option 2 & 3 are correct, but we can't guess whether it is stack or queue, because insertion of new element in stack or queue happen on the top only (end).

Show Answer