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?
What is a potential issue when allocating very large contiguous blocks (>10^8 bytes) dynamically?
Advertisement
Consider this: char *p = malloc(10); strcpy(p, "Hello World"); What occurs?
For implementing a dynamic stack in competitive programming, which memory management approach is best?
Which function in C is used to allocate memory dynamically at runtime?
Which header file must be included to use malloc() and free() functions?
What happens when malloc() fails to allocate memory?
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?
What is the result of calling free() on a NULL pointer?
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?