MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Give routine to insert at the beginning in a linked list whose structure is by struct node, with list head as L and pointer variable as next
A
newnode
B
newnode
C
newnode
D
newnode
Explanation: 

Detailed explanation-1: -To insert a node in between a linked list, we need to first break the existing link and then create two new links. It will be clear from the picture given below. Point the ‘next’ of the new node to the node ‘b’ (the node after which we have to insert the new node).

Detailed explanation-2: -What does the following function do for a given Linked List with first node as head? Explanation: fun1() prints the given Linked List in reverse manner.

There is 1 question to complete.