difference b/w data structures

Is there any difference b/w a table and a map or are they completely same ?


Thanks
There are many different implementations for a "table" and there are different "maps". Which table and map do you mean?

Thus, the answer is: most likely different.
I was just going through data structures and encountered the definition of Table as this :

A table(also called a map, a lookup table, an associative array ,or a dictionary) is a container that allows direct access by any index type .

that is why i asked ……. is this definition wrong then ?
Last edited on
I would say "map" is a more precise word. A "table" could mean multiple things. If you just say "table", and it's not obvious from the context, it might not be clear if you mean a map, a database table or any data structure used to store tabular data.
Last edited on
A map has one index. A table, as per your definition, can have many. Tables like that are common in databases where you might want to lookup the same record (row in a table) using any one of several different column values within it.
The C++ standard has std::map and std::unordered_map. Whether they are "maps" is an another question, but even they differ from each other, because they have been implemented with different data structures. One is presumably a tree and the other a hash.
Topic archived. No new replies allowed.