Closed Thread Icon

Topic awaiting preservation: An introduction to data structures (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28081" title="Pages that link to Topic awaiting preservation: An introduction to data structures (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: An introduction to data structures <span class="small">(Page 1 of 1)</span>\

 
_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

posted posted 06-15-2006 14:50

Ok, this is important and has not been exposed alone at the Asylum.
it's simple, yet sounds silly.

Comps work on information.
But the same information, in two different layouts, will be processed very differently.

That's what data structures are for.

Real-world example: graphics processing units.
Are an extension, and a monstruously powerful one, to the core electronics of a comp, dedicated to spitting out graphics fast.

How comes they differ from the cpu? Are not used instead of the cpu? Because they "only" are good at processing
specific types of informations.
In the end, these informations are binary data, so what makes them different, again?

Theyre layout. Gpus are good at processing vectors and matrices, and related computations, nothing else.
Exceptionally good, but physically geared for that, and nothing else.

....

So, let's list a couple of basic and important data structures:
- tables
- hashtables (key => value to summarize a lot)
- queues (event queues, printing queues - known as lilo: last in, last out)
- linked lists (obj -> obj -> obj -> like a chain of sorts)
- stacks (ever heard of a stack overflow? - known as lifo: last in, first out)
- trees
- graphs (trees where every node can be connected to another)

Anything you are using at the moment on your comp can fall into one of these categories, or a variation.
Example: this thread is a stack of sorts, only thing it is not finite, it's "last in, none out".

The forum hall is the top of a tree of sorts, as well, where forums are nodes, and threads are branches, leading to the leaves, aka posts.
(which is visible in the bread crumbs at the top-right corner, it shows up as a sub-tree).

XML makes for tree or graph structures. An object-oriented diagram is a graph, with nodes interconnected.
Menus of your browser, or the Windows start menu, or any menu for that matter... is a tree.

Etc.

The same task can be accomplished by different data structures, but will be done very differently then.

A good example are search algorithms: there are ways and ways to sort out there, that work differently depending on the amount of info.
Bubble sort is a classic, it's easy to implement, decent on small data sets, ugly and slow on huge data sets.

For large data sets, searches will be based on structures that are more like trees. The haystack, instead of being a linear array, is turned into a tree
and used as that for searching. Works a threat on large data sets.

It's general advice, it probably sounds strange, but it is something very, very important when it comes to making coding style choices.
<end of rant - questions welcome>

Alevice
Paranoid (IV) Inmate

From: Mexico
Insane since: Dec 2002

posted posted 06-15-2006 17:20

The point of this was?

I mean, nice read, but nothing I can't find somewhere else

Sorry, I am just a bit confused as to what were you trying to get into, as most (if not all) of this has existed and been known for what I will assume nearly decades

__________________________________
Something else

Sexy Demoness cel

« BackwardsOnwards »

Show Forum Drop Down Menu