+ 1

double linked list remove duplicate

https://code.sololearn.com/cpO696sbzncN hi friends here is my code i am getting the output correctly but at one stage i am getting segmentation fault when the duplicate number is in the last node... then it's getting segmentation fault. please suggest me the solution

28th Jun 2019, 2:06 AM
malepu rakesh
malepu rakesh - avatar
2 Antworten
+ 2
modify the program using dynamically initialized variable.....
28th Jun 2019, 4:47 AM
Aditya
Aditya - avatar
+ 1
SoloLearn asks for input before the program starts. So your while 1 keeps repeating the software, even if there is no input anymore. This probably is causing an overflow somewhere, probably at the stack, in which throws the segfault you are looking for. I recommend not using while 1, but a validation condition
28th Jun 2019, 2:25 AM
Alexander Santos
Alexander Santos - avatar