Python Forum
an object i would like to have
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
an object i would like to have
#3
i should have also said i want the fetch-one-next-item timing to be the same as or close that for plain set(). sorting the entire set and returning the first from that result is timing i want to avoid. i implemented this kind of thing in C many years ago and it has served me well for almost every container/dictionary usage over the years of coding in C. it worked like a set but allowed each item to be assigned a value. i could search for a given key from the front or the back. multiple items with the same key were allowed (and could be assigned different values). once found, the "next key" could be requested. the group of like keys were kept in the order inserted, and a "next by next" scan would step through them in that order. a "previous by previous" scan would get them in reverse order. it was implemented as an AVL binary tree and outperformed a hash up to a size around 1,200,000.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
an object i would like to have - by Skaperen - May-18-2023, 07:18 PM
RE: an object i would like to have - by snippsat - May-18-2023, 08:00 PM
RE: an object i would like to have - by Skaperen - May-20-2023, 10:59 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020