Home > Computer Science > Human Data Structures

Human Data Structures

In computer science, we frequently have to deal with how to represent our data. Different data structures provide different benefits. It is interesting to consider what data structures we humans are good at.

Probably the most common data structure is an array. It provides random access to any element, but inserting a new element is slow.

Humans are very bad at arrays. Unless the array is very short, we cannot achieve constant-time random access the way a computer can. To access the Nth element, if N is much greater than four or five, we have to simply count up to it.

Humans are much better at linked lists. Like a linked list, elements further down the list are harder to find. We also have a good intuitive understanding of linked lists. While an array is like a grocery list, a linked list is like a deck of cards.

What about associative arrays? The fastest computer implementation of an associative array is a hash table. But, because hash tables are usually implemented using arrays, humans are of course not very good at them. Also, being much slower at math than computers, we would have trouble computing hash functions.

If we want to use an associative array, the best bet for us humans is to implement it with a binary tree. This is how we use dictionaries. There is an alphabetized list of keys (words), each with a corresponding value (definition). We don’t immediately know the location of each word. Instead, we have to do something like a binary search. Let’s say you’re looking up the word “pear”. First you turn to about two-thirds of the way through the dictionary, where you think the P’s will be. Then you turn a few dozen pages forward or backward until you get to the P’s. Then look for ‘Pe’, then ‘Pea’, then ‘Pear’. This is something like a binary search algorithm.

The main advantage that computers have over humans is their ability to quickly access any point in memory. We as humans have to search through the whole list. Perhaps this is why it’s a good idea to use computers to hold our data.

Categories: Computer Science
  1. June 2, 2011 at 3:23 am

    Memory seems to work like a linked list. It’s easy to find the next “element”, but random access is hard. For example, if I tell you one line of a song you can tell me the next, but you usually can’t start a song in the middle. And if I asked you what letter comes after ‘H’ you would have no problem telling me, but if I asked you what is the 18th letter of the alphabet it might take a little longer for you to answer.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: