codebasics / data-structures-algorithms-python

This tutorial playlist covers data structures and algorithms in python. Every tutorial has theory behind data structure or an algorithm, BIG O Complexity analysis and exercises that you can practice on.

Repository from Github https://github.comcodebasics/data-structures-algorithms-pythonRepository from Github https://github.comcodebasics/data-structures-algorithms-python

Why are we not getting an error if the item "figs" isn't even in the list?

whyevenquestion1t opened this issue · comments

Because in the function remove_by_value(self,data), the function would return if data is found and deleted, or it would return when the while loop ends, i.e., we have reached the end of the linked-list without finding the desired data. So if "figs" isn't in the list, this function would return after it goes over the whole list. There would not be any error.