Which of the following is an example for non linear data type?
Answer: A
A data structure is said to be linear if its elements form a sequence or a linear list. For example array, linked list, queue, stack etc. Elements in a non linear data structure do not form a sequence. For example Trees, graphs etc.
Enter details here
Which of the following will return a result most quickly for searching a given key?
Answer: D
None
Enter details here
What is the correct sequence of the compilation Process −
Answer: C
At first it preprocess the code, then compile it, after that it creates assembly level code, or object code, then the linking is taken place.
Enter details here
Why do we write (int *) before malloc?
int *ip = (int *)malloc(sizeof(int));
Answer: B
None
Enter details here
Point out the error in the following program.
#include
#include
int main()
{
int *a[3];
a = (int*) malloc(sizeof(int)*3);
free(a);
return 0;
}
Answer: B
We should store the address in a[i]
Enter details here
Specify the 2 library functions to dynamically allocate memory?
Answer: C
2 library functions to dynamically allocate memory is malloc() and calloc().
Enter details here
Which of the following header files must necessarily be included to use dynamic memory allocation functions?
Answer: A
stdlib.h is a header file which stands for the standard library. It consists of the declaration for dynamic memory allocation functions such as malloc(), calloc(), realloc() and free.
Enter details here
If malloc() successfully allocates memory it returns the number of bytes it has allocated.
Answer: B
No Explanation.
Enter details here