Want to delete the second last element from link list is this algorithm right or not | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Want to delete the second last element from link list is this algorithm right or not

Algorithms:. 1- Ptr=start; 2- If ptr->next == NULL, then: Print "Underflow" Exit; 3- Repeat Step 4 while ptr->next->next!=NULL: 4:- sav= Ptr; Ptr=ptr->next; 5: Delete Ptr . 6:- Exit.

14th Jul 2020, 8:42 AM
Ali abbas
Ali abbas - avatar
5 Answers
+ 3
Robin Well explained 👍
14th Jul 2020, 9:47 AM
Nilesh
Nilesh - avatar
+ 3
Ali abbas I am not a Cpp expert but Yes I will try my best
14th Jul 2020, 9:50 AM
Nilesh
Nilesh - avatar
+ 1
Tnx u very mch Robin
14th Jul 2020, 9:26 AM
Ali abbas
Ali abbas - avatar
0
Nilesh can you plz write this algorithm more clearer to understand
14th Jul 2020, 9:49 AM
Ali abbas
Ali abbas - avatar
0
Nilesh ok try your best plz
14th Jul 2020, 9:56 AM
Ali abbas
Ali abbas - avatar