C-Dynamic Memory Allocation and Data Structure
C-Dynamic Memory Allocation and Data Structure
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
14. If the memory allocation fails, then malloc()
returns
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));
}
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)));
}
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