Closed JunJul closed 2 years ago
@Mridul07Sharma I already upload it as a .cpp file.
I already uploaded it and added two more functions. The search function is to search an element in the list if it cannot find the element, so return -1. If it finds the element, then delete it. We need to move the elements in the array when deleting an element. This remove function still costs O(n). On the contrary, a linked list only need to link node together after removing a node. This is O(1).
I will only upload the .cpp