Lunes, Disyembre 12, 2011

Reflection in the Prelim Topics

I learn about the linked list, stack, array and queues. I enjoy lessening in every discussion. i really like the subject/topic because its really challenging to us to students specially to ME!....

Application(examples)


LINKED LIST
       Data structure composed of nodes, each node holding some information and a reference to another node in the list.
      The main Applications of Linked Lists are
*In Symbol Table

Queues
Imagine you have a web-site which serves files to thousands of users. You cannot service all requests, you can only handle say 100 at once. A fair policy would be first-come-first serve: serve 100 at a time in order of arrival. A Queue would definitely be the most appropriate data structure.
 
Stack
Stacks help computers in unfolding their recursive jobs; used in converting an expression to its postfix form; used in Graphs to find their traversals (we have seen that); helps in non-recursive traversal of binary trees (we'll see this) and so on....

Arrays
Reflection: Arrays are useful mostly because the element indices can be computed at run time
example, an array of 10 integer variables, with indices 0 through 9, may be stored as 10 words at memory addresses 2000, 2004, 2008, … 2036, so that the element with index i has the address 2000 + 4 × i.[4]