Site hosted by Angelfire.com: Build your free website today!


Data Structures
The Lair
Topics:

Stack

Queue

Linked Lists

Tree

Some Tidbits:

    • DATA STRUCTURES- Basically data Structures consists of how data is structured, organized , stored in memory, and also how data is retrieved and manipulated.

    • ARRAY-An array is a collection of elements, all of which are of the same data type (integer, character etc..), have the same name, and are stored in memory locations which are adjacent to one another. Each memory location is identified with an index. An index is a number from 0 to the defined max size of the array. The first index is always 0.
    • Example: int num[10]. This declares the array named num and allocates 10 places in memory for 10 integer values. The index for the first element is num 0, the second is num 1, etc..

    • WAYS TO IMPLEMENT DATA STRUCTURES:
    • -Dynamically: The size of the data structure shrinks and grows during the execution of the program.
      Dynamic Advantages: Saves memory space, Faster when connecting lists, Preserves naturalness.
      Dynamic Disadvantages: Difficult to understand, Memory allocation during run time makes the program run slow.

      -Statically: The memory for a static data structure is determinded before hand by the programmer and does not shrink or grow during execution of the program.
      Static Advantages: Easy to understand, and runs faster overall because the program does not need to stop and allocate the memory during run time.
      Static Disadvantages: Insufficient memory space because there might be more data input than expected. Memory is wasted when a large amount of memory is allocated and only a small portion is used. Static is slow when connecting lists. Static data structure is not natural.

    • MOST COMMONLY USED DATA STRUCTURES:
    • -Stacks
      -Queues
      -Trees
      -Graphs