Data structure for ordered sequence

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jm.suresh@no.spam.gmail.com

    #1

    Data structure for ordered sequence

    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

  • Eric_Dexter@msn.com

    #2
    Re: Data structure for ordered sequence

    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.




    https://sourceforge.net/project/show...roup_id=156455





    jm.suresh@no.sp am.gmail.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

    Comment

    • Fredrik Lundh

      #3
      Re: Data structure for ordered sequence

      Eric_Dexter@msn .com 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>

      Comment

      • Fredrik Lundh

        #4
        Re: Data structure for ordered sequence

        jm.suresh@no.sp am.gmail.com 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>

        Comment

        • jm.suresh@no.spam.gmail.com

          #5
          Re: Data structure for ordered sequence


          Fredrik Lundh wrote:
          jm.suresh@no.sp am.gmail.com 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

          Comment

          • Hendrik van Rooyen

            #6
            Re: Data structure for ordered sequence

            "Fredrik Lundh" <fredrik@python ware.comwrote:

            Eric_Dexter@msn .com 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

            Comment

            • Steve Holden

              #7
              Re: Data structure for ordered sequence

              Hendrik van Rooyen wrote:
              "Fredrik Lundh" <fredrik@python ware.comwrote:
              >
              >
              >Eric_Dexter@msn .com 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 badgerbadgerbad ger?

              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

              Comment

              • robert

                #8
                Re: Data structure for ordered sequence

                jm.suresh@no.sp am.gmail.com wrote:
                Fredrik Lundh wrote:
                >jm.suresh@no.sp am.gmail.com 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

                Comment

                • Fredrik Lundh

                  #9
                  Re: Data structure for ordered sequence

                  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>

                  Comment

                  Working...