Question
a.
int *arr = malloc(M * N * sizeof(int));
b.
int *arr = (int *)malloc(M * N * sizeof(int));
c.
int *arr = (int *)malloc(M + N * sizeof(int));
d.
int *arr = (int *)malloc(M * N * sizeof(arr));
Posted under Data Structures and Algorithms
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. How do you allocate a matrix using a single pointer in C? (M and N are the number of rows and columns respectively)
Similar Questions
Discover Related MCQs
Q. What is the amortized cost per operation of a skew heap?
View solution
Q. Given an array of element 5, 7, 9, 1, 3, 10, 8, 4. Which of the following is the correct sequences of elements after inserting all the elements in a min-heap?
View solution
Q. Which one of the following array elements represents a binary min heap?
View solution
Q. Min heap can be used to implement selection sort.
View solution
Q. An array consists of n elements. We want to create a heap using the elements. The time complexity of building a heap will be in order of
View solution
Q. What is the complexity of adding an element to the heap?
View solution
Q. In which heap the root node must be greatest among the keys present at all of its children?
View solution
Q. How many type of heap are there?
View solution
Q. A ________ is a special Tree-based data structure in which the tree is a complete binary tree.
View solution
Q. How is a bit vector better compared to a normal array for implementing the hash table?
View solution
Q. What is the time complexity to delete an element from the direct address table?
View solution
Q. What is the advantage of using a dynamic set in direct addressing?
View solution
Q. What is the time complexity to insert an element into the direct address table?
View solution
Q. When is it appropriate to use direct addressing?
View solution
Q. In simple chaining, what data structure is appropriate?
View solution
Q. In simple uniform hashing, what is the search complexity?
View solution
Q. What is simple uniform hashing?
View solution
Q. What is the load factor?
View solution
Q. What can be the techniques to avoid collision?
View solution
Q. What is a hash function?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Data Structures and Algorithms? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!