Question
struct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;
a.
ptr = (NODE*)malloc(sizeof(NODE));
b.
ptr = (NODE*)malloc(NODE);
c.
ptr = (NODE*)malloc(sizeof(NODE*));
d.
ptr = (NODE)malloc(sizeof(NODE));
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. Consider the following definition in c programming language.Which of the following c code is used to create new node?
Similar Questions
Discover Related MCQs
Q. Linked lists are not suitable to for the implementation of?
View solution
Q. Linked list is considered as an example of ___________ type of memory allocation.
View solution
Q. In Linked List implementation, a node carries information regarding
View solution
Q. Linked list data structure offers considerable saving in
View solution
Q. Which of the following is not a disadvantage to the usage of array?
View solution
Q. What is the time complexity of inserting at the end in dynamic arrays?
View solution
Q. What is the time complexity to count the number of elements in the linked list?
View solution
Q. What is the space complexity for deleting a linked list?
View solution
Q. Which of these is an application of linked lists?
View solution
Q. What differentiates a circular linked list from a normal linked list?
View solution
Q. What is the time complexity of searching for an element in a circular linked list?
View solution
Q. Which of the following application makes use of a circular linked list?
View solution
Q. Which of the following is false about a circular linked list?
View solution
Q. Consider a small circular linked list. How to detect the presence of cycles in this list effectively?
View solution
Q. What is a skip list?
View solution
Q. Skip lists are similar to which of the following datastructure?
View solution
Q. What is the time complexity improvement of skip lists from linked lists in insertion and deletion?
View solution
Q. To which datastructure are skip lists similar to in terms of time complexities in worst and best cases?
View solution
Q. The nodes in a skip list may have many forward references. their number is determined
View solution
Q. Are the below statements true about skiplists?
In a sorted set of elements skip lists can implement the below operations
i.given a element find closest element to the given value in the sorted set in O(logn)
ii.find the number of elements in the set whose values fall a given range in O(logn)
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!