Give syntax to create a node for Single linked list? Data Structure

  • newnode=(struct node *)malloc(sizeof(struct node*));
  • newnode=(struct node )malloc(sizeof(struct node));
  • newnode=(struct node *)malloc(sizeof(struct node));
  • newnode=(struct node )malloc(sizeof(struct node*));
Answer: newnode=(struct node *)malloc(sizeof(struct node*));
1018 students attemted this question.

Explanation

No Explanation Available.

Share this question with friends

Similar Questions

  1. Two lists, A and B are implemented as singly linked link-lists. The address of the first and last node are stored in variables firstA and lastA for list A and firstB and lastB for list B. Given the address of a node is given in the variable node, the element stored in the node can be accessed by the statement node->data and the address to the next node can be accessed by node->next. Pankaj wants to append list B at end of list A. Which of the following statements should he use?

  2. A variant of linked list in which last node of the list points to the first node of the list is?

  3. Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?

  4. State true of false.i) A node is a parent if it has successor nodes.ii) A node is child node if out degree is one.

  5. In linked list, the elements are using _________ to linked the data item to the next address in memory location.

  6. What does the following function do for a given Linked List with first node as head?

  7. In linked list each node is divided into ___________parts?

  8. How to insert a node after a position P in singly linked list?

  9. In linked list each node contain minimum of two fields. One field is data field to store the data second field is?

  10. In circular linked list, insertion of node requires modification of?

  11. If node N is a terminal node in a binary tree then its ________

  12. Statement 1: When a node is split during insertion, the middle key is promoted to the parent as well as retained in right half-node.Statement 2: When a key is deleted from the leaf, it is also deleted from the non-leaf nodes of the tree.

  13. ._____________ is a data structure in which every individual node consists of INFO to store data and LINK to store the address of the next node.

  14. Linked list data structure offers considerable saving in _____________

  15. The disadvantage in using a circular linked list is __________

  16. What advantage does a linked list have over an array?

  17. Which of the following points is/are true about Linked List data structure when it is compared with array

  18. What kind of linked list is best to answer question like “What is the item at position n?”

  19. Linked list is considered as an example of ___________ type of memory allocation.

  20. What data structure can be used to check if a syntax has balanced paranthesis ?

Comments

Add Your Review

Your email address will not be published.

Subscribe to Newsletter!

Subscribe to get latest updates and information.