Not look at our list which is an implementation often listen into office it is one of the most commonly 2
used data structures beautifullest is because some of the important things about orderless and in the 3
next lesson be able to write them off it as the name implies it is an implementation. 4
Often listening to this update is resizable do so internally it uses an added since it is used internally 5
. 6
It obviously has some size associated with it and by default it is dead. 7
So when this capacity is reached a new array is created that the size that is around 50 percent larger 8
than the old arrays ice on the array contents are copied into the new ID. 9
So whenever array sizes reach the resizing of the Oddy. 10
About 50 percent. 11
Business must have big disk value. 12
After performing loff experiments because if it is too high a value like say 100 percent then it can 13
be an overkill. 14
That is it may consume too much of memory. 15
Typically such are resizing should not matter. 16
But if you feel you are dealing with a large number of elements then you can create an idealist with 17
the high initial capacity. 18
Using this constructor all you can also use this method in short capacity before adding large number 19
of elements. 20
That is the new capacity as an argument with this method and it allows storing duplicates and also not 21
to use on here it's typical use cases you would use it when you want to iterate a list of elements like 22
a list of elements fetched from a database. 23
Since it is an RDBMS implementation you do get the benefit of fast random access. 24
That is you can access the elements in constant time so the size of your collection does not matter 25
. 26
Now if appending elements to the list or removing the last element is a frequent operation then you 27
can use an audit list as both these operations can be performed in constant time. 28
Only thing to note about appending an element is that when the other illness and denote capacity is 29
reached then appending a new element would trigger resizing. 30
In that case there would be some additional time in. 31
No let's look at some of them. 32
It's not a list. 33
And what does methods do. 34
What are already discussed. 35
Then be looked at list collection interfaces. 36
However our list has its own way of implementing these methods. 37
First is the IDE method which acts an element a specified index the specified next is something other 38
than the last index. 39
Then when we add an element all the elements following it will be shifted right by one position. 40
So if there are an elements and you're adding an element at the zero position then all elements will 41
be shifted right hence in the book is time complexity is linear. 42
Similarly a real movement that removes an element from the specified index and in this case if an element 43
is added more all the following elements will be shifted left by one position. 44
So like in the case of I if the first element is removed then the verse gives complexity to bilinear 45
unbonded it is because these two methods contains an index off both of these are search methods and 46
contains method would return true if the specified element is present in the idlest while index off 47
method returns the index number of the specified element in the other list. 48
If the specified element is presumed and the artist on it will take an A minus one if the element is 49
not present. 50
Bought them at skandha other list from the beginning of that list. 51
Unhandsome the bookcase. 52
The complexity can be linear. 53
That is when the specified element happens to be the last element in the list. 54
Then the title is discovered and these methods use equals method to compare the input element bit each 55
of the elements in the list. 56
Recall that equals methods from the Object class and it can be overridden by any subclass. 57
Not if there are frequent searches then go with the set implementation for example hash Sipkin such 58
an element in constant time and after a few lessons that we'll be discussing Hasselt next is in the 59
. 60
And we know that to be most all the elements in the current list which are also present in the input 61
collection and dumps off implementation the method invokes the contains method off the input collection 62
object for each element in the list. 63
No element is present then it uses that be movement of the other list to remove the element and dumps 64
off complexity. 65
It can be worse than quadratic and that's because it would be off and 42 dating all the elements in 66
the current idlest then each contains invocation can be another. 67
Often if the input collection object is a list if input collection object is one of the set implementations 68
then it would be better as their contains method books faster. 69
As discussed earlier on it would be an either or. 70
And if the current element is removed from the list as it would result in Alimentarius so it can seriously 71
affect performance. 72
If you're dealing with large collections linguist on has said are better for one you will understand 73
it. 74
Once we covered those topics written on also has identical performance issues on here are some of the 75
matters that run in constant time. 76
Sit and get Minturn's run in constant time as an array is used as underlying data structure. 77
We've discussed both iterator and mistreated or methods. 78
So that's about it. 79
And the next lesson will lead them off our list. 80
Thank you