Data structure for ordered sequence

Discussion in 'Python' started by jm.suresh@no.spam.gmail.com, Nov 13, 2006.

  1. Guest

    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
     
    , Nov 13, 2006
    #1
    1. Advertising

  2. Guest

    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/showfiles.php?group_id=156455
    http://www.dexrow.com




    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
     
    , Nov 13, 2006
    #2
    1. Advertising

  3. 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>
     
    Fredrik Lundh, Nov 13, 2006
    #3
  4. 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>
     
    Fredrik Lundh, Nov 13, 2006
    #4
  5. Guest

    Fredrik Lundh wrote:
    > 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
     
    , Nov 13, 2006
    #5
  6. "Fredrik Lundh" <> wrote:


    > 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
     
    Hendrik van Rooyen, Nov 14, 2006
    #6
  7. Steve Holden Guest

    Hendrik van Rooyen wrote:
    > "Fredrik Lundh" <> wrote:
    >
    >
    >> 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
     
    Steve Holden, Nov 14, 2006
    #7
  8. On Tue, 14 Nov 2006 09:25:22 +0000, Steve Holden <>
    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

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
     
    Dennis Lee Bieber, Nov 14, 2006
    #8
  9. robert Guest

    wrote:
    > Fredrik Lundh wrote:
    >> 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
     
    robert, Nov 16, 2006
    #9
  10. 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>
     
    Fredrik Lundh, Nov 16, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newbie
    Replies:
    1
    Views:
    536
    Andrew Thompson
    Apr 7, 2004
  2. stef mientki
    Replies:
    13
    Views:
    664
    stef mientki
    Oct 20, 2007
  3. A
    Replies:
    27
    Views:
    1,646
    Jorgen Grahn
    Apr 17, 2011
  4. DL

    Ordered list inside ordered list

    DL, Nov 9, 2009, in forum: Javascript
    Replies:
    6
    Views:
    335
    Dr J R Stockton
    Nov 21, 2009
  5. Replies:
    3
    Views:
    366
    Rick Johnson
    Feb 28, 2013
Loading...

Share This Page