Search code examples
data-structureslanguage-agnosticterminology

Data Structure Terminology?


I have a good amount of questions regarding data structure vocabulary. I'm sure I know what these are/do, but I did not learn the appropriate terms for them or I forgot them, so when someone uses them in an explanation I am confused as to what exactly they mean.

In class we are dealing with hash tables and the terms 'key' and 'bucket' came up. I tried finding out what they mean, and so far what I have understood is that a key refers to an element in the hash table, while a bucket refers to certain place in the hash table. For example, HashTable[index] refers to a bucket (a 'row' in the hash table, if you will). If that spot in the hash table contains a chain (and the linked list is composed of 'blocks' interconnected), then a key would be a single 'block' in that chain. Is that correct? (As you can tell, I also forgot the term for a 'block' in a linked list)

And on a different topic, we were also dealing with amortized doubling earlier in the year and I have no clue what 'amortized analysis' refers to.

I know some of these might seem like dumb questions but I want to get my terminology right. (I can't stress how frustrating it is when someone uses incorrect terminology when explaining something. Like when my Calc professor refers to 'doing the dot product' as 'marrying the vectors')

Thanks in advance.


Solution

  • This is actually not C++ terminology. C++ has something called an unordered_map that provides hash-table-like functionality, but "hash table", "bucket", "key" and the other terms are generic computer-science/programming data-structure and algorithms terminology.

    See http://en.wikipedia.org/wiki/Hash_table for more details, and note that C++ is barely mentioned in the article.