then that again will be cost in time but if we would insert element at a particular position in the list then we will have to shift elements towards higher indices. In the worst case we will have to shift all the elements to the right when we will be inserting at the first position , so the time taken for insertion uh... will be proportional to the length of the list let's say the length of the list is n or, in other words, we will say that insertion will be Big Oh of n in terms of time complexity if you do not know about Big Oh notation, do not bother, just understand that, inserting an element at the particular position will be a linear function in terms of the size of the list. Removing an element will again be big oh of n Time taken will be proportional to the current size of the list. n is the size of the list here.
ok now, inserting an element at the end we just said that it will happen in constant time it is not so if the array is full then we will create a new array uh... lets call inserting element at the end as adding an element adding an element will take constant time if the list is not full but it will take time proportional to the size of the list, size of the array, if array is full. So, adding in the worst case will be big oh of n again as we said when the list is full we create a new copy double the size of the previous array and when we copy the previous array, elements from previous array into the new array ,so primafacy what looks like the good thing with this kind of implementation Well, the good thing is that we can access elements at any index in constant time which is the property of the array but if we have to insert some element in between and if we have to remove element from the list then it is costly. if the list grows and shrinks a lot then we will also have to create a new array and have all this thing of copying elements from previous array to a new array again and again and one more problem is that a lot of time a lot of the array would be unused. The memory there, is of no use Definitely the use of array as dynamic list is not efficient in terms of memory this kind of implementation is not efficient in terms of memory This leads us to think- can we have a data structure that will give us a dynamic list and use the memory more efficiently we have one data structure that gives us good utilization of the memory and this data structure is linked list and we will study about the linked list in the next lesson. So that's it for this lesson. Thanks for watching!