- 2
Algorithms:. 1- Ptr=start; 2- If ptr->next == NULL, then: Print "Underflow" Exit; 3- Repeat Step 4 while ptr->next->
I have written this algorithm for deleting 2nd last element in link list is this right or not .
4 Answers
+ 1
Why I can't see the 4th step that should be repeated as you wrote?
Write the pseudo code in Description, more room for typing there. Use the question title to describe the question briefly e.g. "algorithm for linked-list element"
Good luck! đ
0
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.
0
Plz answer me is this correct or wrong and if this is wrong then what changes should be make
0
Bro I see you posted new question where you write the pseudo code in Description. So in order to keep duplicates to the minimum you can delete this one, and monitor the new thread.
Hope you got what you came for! đ