C-Dynamic Memory Allocation and Data Structure Questions and Answers
Data Structure and Algorithms questions with answers are crucial for technical interviews and competitive exams like GATE, Infosys, and TCS. This topic tests understanding of arrays, linked lists, stacks, queues, trees, and sorting algorithms. Programming interview questions with answers in this section focus on time complexity, optimization, and problem-solving efficiency. Practicing DSA MCQs strengthens core programming logic, helping candidates excel in both written tests and coding interviews.
Detailed questions on dynamic memory use. For further practice, try database data models and data structures algorithms
C-Dynamic Memory Allocation and Data Structure
Showing 10 of
104 questions
11. Linear as well as non-linear data structure is possible in
- Singer linked list
- Circular linked list
- Double linked list
- All the above
12. Stack is useful for implementing
- Recursion
- Breath first search
- Both a and B
- None of these
13. Which of the following is useful in implementing quick sort/
- Stack
- Queue
- List
- Set
14. If the memory allocation fails, then malloc() returns
- NULL
- A positive value
- A negative value
- None of the these
15. State the incorrect statement.
- A circular list doesn't have a natural first or last node.
- It is always desirable to keep an extra node at the front of the list.
- A stack can't be represented in memory using linear arrary.
- All of the above
16. The default initial value of malloc () memory allocation is
- Garbage
- NULL
- -1
- None of these
17. 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)); }
- 2 2
- 4 4
- dependsd on compiler
- Compilation error
18. Find the output void main ( ) { printf('%d", sizeof(malloc(10))); }
- 2
- 10
- 20
- None of these
19. Which is not true about queue/
- it follows FIFO data structure.
- In queue the insertion and deletion terminology are known as enqueue and dequeue.
- Testing for underflow for circular queue is similar to that of a linear queue.
- None of the above
20. Linked list are not suitable for implementing
- Insertion sort
- Binary search
- Radix sort
- Polynomial manipulation