πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #83

Pregunta ordenes de tiempo en PHP

#83
From: Chano
Date: Fri, 09 Sep 2005 01:06
21 lines
1866 bytes
  En PHP, si tengo un array,  $variable[$indice] = algo , por ejemplo , en donde $indice
es un valor entero mayor a cero y no consecutivo (9,1,345, 123, 244), cual es el 
orden ( O(x) ) de hacer la operacion:

if ( $variable[$valor] )

  O sea, consultar si un valor estΓ‘ definido como llave en un arreglo.

  Se comportara como un hash, por lo que seria O(1), o no?

  Gracias :)

(con orden me refiero a que, por ejemplo, el orden de una busqueda secuencial
sobre n elementos es O(n). Un for de 1 a n, dentro de un for de 1 a m es O(n*m) )
-- 
Chano
jgarrido[@]dcc.uchile.cl
Technical Details
Message-ID: <dfqn6d$u0h$1@localhost.localdomain>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!novia!newsfeed.yul.equant.net!news-santiago!helcaraxe.dcc.uchile.cl!news.cec.uchile.cl!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,ba4785603e789050,start
X-Google-Thread: 107d6b,ba4785603e789050,start
X-Google-Attributes: gid1593cb,gid107d6b,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!novia!newsfeed.yul.equant.net!news-santiago!helcaraxe.dcc.uchile.cl!news.cec.uchile.cl!not-for-mail
From: Chano <chano@lj.NOSPAM.cl>
Newsgroups: chile.comp.programacion,chile.comp.misc
Subject: Pregunta ordenes de tiempo en PHP
Date: Fri, 9 Sep 2005 01:06:21 +0000 (UTC)
Organization: Chano Records Inc.
Lines: 21
Sender: Jose Miguel Garrido Urzua <jgarrido@cipres.cec.uchile.cl>
Distribution: world
Message-ID: <dfqn6d$u0h$1@localhost.localdomain>
Reply-To: Chano <chanorecords@gmail.com>
NNTP-Posting-Host: cipres.cec.uchile.cl
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: localhost.localdomain 1126227981 30737 200.9.100.5 (9 Sep 2005 01:06:21 GMT)
X-Complaints-To: news@localhost.localdomain
NNTP-Posting-Date: Fri, 9 Sep 2005 01:06:21 +0000 (UTC)
X-Nick: Chano
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))