Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Data structure for ordered sequence

Reply
Thread Tools

Data structure for ordered sequence

 
 
jm.suresh@no.spam.gmail.com
Guest
Posts: n/a
 
      11-13-2006
Dear all,
I am looking for a data structure to hold rectangles in a 2d space.
Please point me to any module which does these operations:
Insert a rectangle into a particular co-ordinate.
Get the rectangle/s right/left/above/below side to a particular
rectangle.
Get all the rectangles within a box
Delete a particular rectangle.

--
thanks.
Suresh

 
Reply With Quote
 
 
 
 
Eric_Dexter@msn.com
Guest
Posts: n/a
 
      11-13-2006
There are probily better ways to do this. The pil library has a
rectangle drawing feature, I would check through the docs of wxwindows
and tkinter unless this is homework because the pil people will not let
you distribute pils. I am going to be looking for the same think let
me know if you get a better answer.

http://my.opera.com/yjfuk/blog/index.dml/tag/captcha


https://sourceforge.net/project/show...roup_id=156455
http://www.dexrow.com




http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Dear all,
> I am looking for a data structure to hold rectangles in a 2d space.
> Please point me to any module which does these operations:
> Insert a rectangle into a particular co-ordinate.
> Get the rectangle/s right/left/above/below side to a particular
> rectangle.
> Get all the rectangles within a box
> Delete a particular rectangle.
>
> --
> thanks.
> Suresh


 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      11-13-2006
(E-Mail Removed) wrote:

> unless this is homework because the pil people will not let
> you distribute pils.


I'm not sure I can parse this sentence fragment. What do you mean?

</F>

 
Reply With Quote
 
Fredrik Lundh
Guest
Posts: n/a
 
      11-13-2006
(E-Mail Removed) wrote:

> I am looking for a data structure to hold rectangles in a 2d space.
> Please point me to any module which does these operations:
> Insert a rectangle into a particular co-ordinate.
> Get the rectangle/s right/left/above/below side to a particular
> rectangle.
> Get all the rectangles within a box
> Delete a particular rectangle.


how many rectangles do you plan to store in this structure?

</F>

 
Reply With Quote
 
jm.suresh@no.spam.gmail.com
Guest
Posts: n/a
 
      11-13-2006

Fredrik Lundh wrote:
> (E-Mail Removed) wrote:
>
> > I am looking for a data structure to hold rectangles in a 2d space.
> > Please point me to any module which does these operations:
> > Insert a rectangle into a particular co-ordinate.
> > Get the rectangle/s right/left/above/below side to a particular
> > rectangle.
> > Get all the rectangles within a box
> > Delete a particular rectangle.

>
> how many rectangles do you plan to store in this structure?
>
> </F>


Around 150 max

Thanks for the response.
--
Suresh

 
Reply With Quote
 
Hendrik van Rooyen
Guest
Posts: n/a
 
      11-14-2006
"Fredrik Lundh" <(E-Mail Removed)> wrote:


> (E-Mail Removed) wrote:
>
> > unless this is homework because the pil people will not let
> > you distribute pils.

>
> I'm not sure I can parse this sentence fragment. What do you mean?


oh come on! - you of all people should know that "pils" means mushroom...

- Hendrik

 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      11-14-2006
Hendrik van Rooyen wrote:
> "Fredrik Lundh" <(E-Mail Removed)> wrote:
>
>
>> (E-Mail Removed) wrote:
>>
>> > unless this is homework because the pil people will not let
>>> you distribute pils.

>> I'm not sure I can parse this sentence fragment. What do you mean?

>
> oh come on! - you of all people should know that "pils" means mushroom...
>

Cue yet another appearance of badgerbadgerbadger?

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

 
Reply With Quote
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      11-14-2006
On Tue, 14 Nov 2006 09:25:22 +0000, Steve Holden <(E-Mail Removed)>
declaimed the following in comp.lang.python:

> Cue yet another appearance of badgerbadgerbadger?
>

Or just a lot of beer, if one takes "pils" as a truncation of
"pilsner" {blah... give me a good German double-bock}

--
Wulfraed Dennis Lee Bieber KD6MOG
(E-Mail Removed) (E-Mail Removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (E-Mail Removed))
HTTP://www.bestiaria.com/
 
Reply With Quote
 
robert
Guest
Posts: n/a
 
      11-16-2006
(E-Mail Removed) wrote:
> Fredrik Lundh wrote:
>> (E-Mail Removed) wrote:
>>
>>> I am looking for a data structure to hold rectangles in a 2d space.
>>> Please point me to any module which does these operations:
>>> Insert a rectangle into a particular co-ordinate.
>>> Get the rectangle/s right/left/above/below side to a particular
>>> rectangle.
>>> Get all the rectangles within a box
>>> Delete a particular rectangle.

>> how many rectangles do you plan to store in this structure?
>>
>> </F>

>
> Around 150 max
>


And seeking/change frequency? fix dimensions? Probably for a GUI/mouse thing.
=>Not worth worring about a 2D-tree structure. A Python list ? Insert/change coordinates at no costs and seek the list with a 3-liner and you are quite fast Any sophisticated tree fumbling will cost more.
Or at max use a 1D-btree thing or so for x0,x1 or a fix 16x16 array ..

-robert
 
Reply With Quote
 
Fredrik Lundh
Guest
Posts: n/a
 
      11-16-2006
robert wrote:

>>> how many rectangles do you plan to store in this structure?

>
>> Around 150 max

>
> And seeking/change frequency? fix dimensions? Probably for a GUI/mouse thing.
> =>Not worth worring about a 2D-tree structure. A Python list ?
> Insert/change coordinates at no costs and seek the list with a
> 3-liner and you are quite fast Any sophisticated tree
> fumbling will cost more.
> Or at max use a 1D-btree thing or so for x0,x1 or a fix 16x16 array ..


thanks for writing the reply I didn't get around to write

</F>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
*Could use some help here* Ruby script that downloads .png files thatare ordered in sequence and saves them locally. patrick.anthony124@gmail.com Ruby 3 02-28-2013 01:12 AM
Simple structure and copying data to pointer of the same structure A C++ 27 04-16-2011 11:07 PM
Ordered list inside ordered list DL Javascript 6 11-21-2009 11:43 PM
how to iterate over sequence and non-sequence ? stef mientki Python 13 10-20-2007 10:21 AM
BOOT SEQUENCE (how to change boot sequence) bird Computer Support 13 12-24-2003 02:20 AM



Advertisments