Re: How to count value in a ArrayList
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Sat, 24 May 2008 15:00:12 -0400
j1mb0jay wrote:
On Sat, 24 May 2008 13:35:03 -0400, Arne Vajhøj wrote:j1mb0jay wrote:On Sat, 24 May 2008 11:01:49 -0400, Arne Vajhøj wrote:So does an array list for operations at the tail.j1mb0jay wrote:A well distributed hash table has a BigO(1) for all operations (Insert,If you input the the data into a hash table rather than a ArrayList,Is that different from ArrayList ??
that will clone itself when it gets full and is rather slow. Then
when you want to look for an item you will only have to look at one
item to see if you have it, rather than the whole list.
Search and Remove).
Until the backing array is full.
And a hash table has the same issue.
How can an array list have a O(1) Search, when it has to look at each item and compare. Dont be so silly !!!
Both inserting at the tail and removing from the tail is O(1).
Technically speaking searching at the tail is also O(1), but there
is not much point in that.
Arne
.
- References:
- How to count value in a ArrayList
- From: Tony
- Re: How to count value in a ArrayList
- From: Ignacio Machin ( .NET/ C# MVP )
- Re: How to count value in a ArrayList
- From: Arne Vajhøj
- Re: How to count value in a ArrayList
- From: Arne Vajhøj
- How to count value in a ArrayList
- Prev by Date: Re: call a function every 5 seconds
- Next by Date: Why event handler first parameters are incorrect
- Previous by thread: Re: How to count value in a ArrayList
- Next by thread: Re: How to count value in a ArrayList
- Index(es):