Akash Rawal
Akash Rawal

Reputation: 144

Name this data structure?

I have a data structure that supports following operations:

  1. An item can be inserted in constant time. For that item the data structure assigns a unique positive integer. (Clarification: assigned integer is not a function of inserted item, and user has no choice on the assigned integer. It is chosen solely by the data structure.)
  2. Using that integer the item can be found in constant time.
  3. Using that integer the item can be removed in constant time.

It is implemented using an array of pointers where the assigned integers are indices where the items are stored. Unused indices are chained up in linked-list fashion for constant time insertion.

What is/should be the name of such data structure?

Upvotes: 3

Views: 147

Answers (2)

vikrant
vikrant

Reputation: 433

As it sounds like a hash based data structure, how about calling it "Simple Hash List". Read more about hash list here http://en.wikipedia.org/wiki/Hash_list

Upvotes: 0

John Zwinck
John Zwinck

Reputation: 249113

It's an array with a "free list."

Upvotes: 8

Related Questions