C-Dynamic Memory Allocation and Data Structure Questions and Answers

Practice Mode
Showing 10 of 104 questions
Q11
Linear as well as non-linear data structure is possible in
  • A Singer linked list
  • B Circular linked list
  • C Double linked list
  • D All the above
Answer: Option D
Q12
Stack is useful for implementing
  • A Recursion
  • B Breath first search
  • C Both a and B
  • D None of these
Answer: Option A
Q13
Which of the following is useful in implementing quick sort/
  • A Stack
  • B Queue
  • C List
  • D Set
Answer: Option A
Q14
If the memory allocation fails, then malloc() returns
  • A NULL
  • B A positive value
  • C A negative value
  • D None of the these
Answer: Option A
Q15
State the incorrect statement.
  • A A circular list doesn't have a natural first or last node.
  • B It is always desirable to keep an extra node at the front of the list.
  • C A stack can't be represented in memory using linear arrary.
  • D All of the above
Answer: Option B
Q16
The default initial value of malloc () memory allocation is
  • A Garbage
  • B NULL
  • C -1
  • D None of these
Answer: Option A
Q17
Find the output void main ( ) { typedef struct { int info; struct node *ad; }node; node *p,*q; p=malloc(sizeof(node)); q=malloc(sizeof(node)); printf("%d %d", sizeof(p), sizeof(q)); }
  • A 2 2
  • B 4 4
  • C dependsd on compiler
  • D Compilation error
Answer: Option C
Q18
Find the output void main ( ) { printf('%d", sizeof(malloc(10))); }
  • A 2
  • B 10
  • C 20
  • D None of these
Answer: Option A
Q19
Which is not true about queue/
  • A it follows FIFO data structure.
  • B In queue the insertion and deletion terminology are known as enqueue and dequeue.
  • C Testing for underflow for circular queue is similar to that of a linear queue.
  • D None of the above
Answer: Option C
Q20
Linked list are not suitable for implementing
  • A Insertion sort
  • B Binary search
  • C Radix sort
  • D Polynomial manipulation
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test