Re: [Python-Dev] When do sets shrink?
by Fredrik Lundh other posts by this author
Dec 29 2005 8:21AM messages near this date
Re: [Python-Dev] When do sets shrink?
|
Re: [Python-Dev] When do sets shrink?
Noam Raphael wrote:
> I'm not saying that practically it must be used - I'm just saying that
> it can't be called a heuristic, and that it doesn't involve any "fancy
> overkill size hinting or history tracking". It actually means
> something like this:
> 1. If you want to insert and the table is full, resize the table to
> twice the current size.
> 2. If you delete and the number of elements turns out to be less than
> a quarter of the size of the table, resize the table to half of the
> current size.
sure sounds like a heuristic algorithm to me... (as in "not guaranteed to
be optimal under all circumstances, even if it's probably quite good in all
practical cases")
</F>
_______________________________________________
Python-Dev mailing list
Python-Dev@[...].org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.c
om
Thread:
Noam Raphael
Noam Raphael
Fernando Perez
Raymond Hettinger
Raymond Hettinger
Noam Raphael
Tim Peters
Josiah Carlson
Raymond Hettinger
"Martin v. Löwis"
Fredrik Lundh
Noam Raphael
Josiah Carlson
Donovan Baarda
Fredrik Lundh
Noam Raphael
"Martin v. Löwis"
Adal Chiriliuc
1
Adal Chiriliuc
Raymond Hettinger
Donovan Baarda
Noam Raphael
Guido van Rossum
Noam Raphael
Josiah Carlson
"Martin v. Löwis"
Noam Raphael
|