Computer Science, asked by kg851516, 5 months ago

write an algorithm for transversing nodes in a single linked list? Explain with an eg.​

Answers

Answered by prachinigam2006
1

Answer:

hii I think that it helps you

Explanation:

Algorithm

STEP 1: SET PTR = HEAD.

STEP 2: IF PTR = NULL.

STEP 4: REPEAT STEP 5 AND 6 UNTIL PTR != NULL.

STEP 5: PRINT PTR→ DATA.

STEP 6: PTR = PTR → NEXT.

STEP 7: EXIT.

Answered by ItzRisingStar
1

</p><p>{\mathtt{\huge{\purple{\underline{Answer}}}}}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Declare a pointer to node type variable to store link of first node of linked list. Say head = (struct node*)malloc(sizeof(struct node)); . If there is no memory to allocate for head node i.e. head == NULL . Then print some error message and terminate program, otherwise move to below step.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

\huge\purple{★}\pink{ItzRisiηgStɑr}\purple{★}

Similar questions