In a competitive programming scenario, you need to store strings dynamically. What is safe practice?
A program uses realloc() to expand an array from 100 to 200 elements. The old address is p. After realloc():?
For a graph with V vertices and E edges stored dynamically, what is typical space complexity?
What is the critical issue with this code? int *p = (int*)malloc(sizeof(int)); free(p); p = NULL;
In 2024-2025 competitive exams, for storing variable number of test cases (up to 10^5), which approach is optimal?
Advertisement
In a competitive programming problem, you need to allocate a 2D array of size 5x5 dynamically. Which approach is most efficient?
What is the critical issue with this code snippet?
int *ptr = (int*)malloc(10);
ptr[11] = 5;
Which of the following is a memory leak?
In the 2024-2025 competitive exam pattern, a dynamic array needs to grow from 100 to 200 elements. Using realloc(), what should be the concern?
Which scenario represents a use-after-free error?
For storing variable-length strings dynamically in a competitive program, what's the safest approach?
What potential issue occurs with this code in a large-scale system?
while(1) { int *arr = malloc(1000000); }
In graph algorithms with dynamic adjacency lists, what's the memory requirement for a sparse graph with V vertices and E edges?
What is the advantage of dynamic allocation over static allocation in competitive programming?
Which function should be used to allocate memory for an array of 50 structures of size 'sizeof(struct Node)' and initialize to zero?
What happens when you try to free a pointer that was not allocated by malloc/calloc/realloc?
Which of the following correctly deallocates a 2D dynamically allocated array created as int **arr?
What happens when realloc() is called on a pointer allocated by malloc() with a larger size?
For implementing a dynamic circular buffer of size n, how many pointers are minimally required?
Which scenario is most likely to cause a segmentation fault in dynamic memory?