• Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

Explain the different data structures that are avaliable to computer programmers, giving examples of their use, and reasons why they would be chosen instead of others.

Extracts from this document...


Explain the different data structures that are avaliable to computer programmers, giving examples of their use, and reasons why they would be chosen instead of others. Introduction Dats structures are one of the most common principles computer operation, the ability to locate, add or delete data is common and used as soon as you turn on your computer system. The fundamental reason for using data structures is that it uses efficient ways of carrying out the above operations when large amounts of data are involved in the calculations. Lists, string, stacks, queues, arrays & trees are some of the most common data structures. They have been adapted from many pre-computing methods, as a queue in its principal is exactly the same as a queue in a shop for items, for example. Linear List A linear list could be considered a one-dimensional array. The list of numbers form what is called a linear list, ie. "5.1, 1.2, .5.9, .3.6, .4.7". Those numbers on themselves are meaningless data, however with a context it becomes information, for example "5.1 is the 0-60 time of a car" would be a suitable context. The data in the list has to have a numeric amount of >=0. Data can be stored inside computers as a linear list. If an item has to be added, then the item of data in the middle of the list, then all the data after the item needs to be inserted after the item to make way for the new item of data. ...read more.


The pseudocode to delete some data from a queue could be shown as the following: PROCEDURE INSERT(Size, Start_Pointer, Stop_pointer, Data) (*is queue full?*) IF start_pointer = 1 AND Stop_Pointer = Size OR Start_Pointer = Stop_Pointer + 1 THEN PRINT Queue is already full EXIT PROCEDURE ENDIF (*Check to see if queue is empty*) IF Start_pointer = 0 THEN (*initialise queue*) SET Start_pointer = 1 and SET Stop_pointer = 1 (*Queue not empty, update pointers*) ELSE IF Stop_pointer = Size THEN SET Stop_pointer = 1 (*Put stop_pointer back to beginning*) ELSE SET Stop_pointer = Stop_pointer + 1 (*Update stop_pointer*) ENDIF ENDIF QUEUE(Stop_pointer) = Data (*Store data in queue*) END PROCEDURE Arrays An array is ordering of data elements so that information can be extracted from them. The size of an array depends on the number of rows and columns. Most high level languages allow many more than two or three dimensional arrays, however much memory is consumed for multi-dimensional arrays. Eg. A 5-D array containing 10 elements in each D would require: 10 X 10 X 10 X 10 X 10 = 100,000 locations. (if each number could be scored in one location). Arrays must be represented in computers as a linear list ( a 1-D array). To represent an array in a computer's memory requires mapping of each element of the array to the corresponding locations that will score the array. ...read more.


Although this is easier to quickly locate data in this way, it is more difficult to add and delete nodes compared with that of linear lists. It is usual to use some form of stack, so that the route though the tree can be tracked to the previously visited nodes. Binary Trees These are a kind of the 'parent' node is only allowed two terminal nodes. Binary tree structures are implemented using pointer systems in similar ways to the node pointers used with linked lists. Once the child node from the parent node is chosen, the further choices exist in a 'sub-tree' because the root node is no longer entirely accessible. Hash tables A hash funtion is a set of rules when applied to a five digit key field creates a suitable address in the table. The has function is simmialr to a pointer that is used to point to a location where the necessary data is located. A generalised has function is used simmialry to the following example Address = Hash function (key field) Hash function = key field is squared, then taken right- hand digits and finally add 1. Using the hashing function for the following number: (12345) we get: Original Number|Number squared|Right-hand three digits|Right-hand three digits ADD 1 12345 152399025 025 26 One disadvantage of the hashing function is their ability to create the same address within the table for different key fields. This is known as a collision. ?? ?? ?? ?? 1 2.05 ...read more.

The above preview is unformatted text

This student written piece of work is one of many that can be found in our AS and A Level Computer Science section.

Found what you're looking for?

  • Start learning 29% faster today
  • 150,000+ documents available
  • Just £6.99 a month

Not the one? Search for your essay title...
  • Join over 1.2 million students every month
  • Accelerate your learning by 29%
  • Unlimited access from just £6.99 per month

See related essaysSee related essays

Related AS and A Level Computer Science essays

  1. Peer reviewed

    Principles of Computer Networks

    3 star(s)

    The ring goes around and station wanting to transmit data will take control of it and send it to the destination and when the transmission is completed than the token ring is destroyed and new one is created. IEEE 802.11 Set of standards which put into operation WLAN communication in the 2.4, 3.6 and 5 GHz spectrum band.

  2. Different ways of data capture

    Lack of referential integrity 6. Linking isn't possible between flat files CONSISTENCY - Same all way through INTEGITY - Correct them - errors on input errors on op systems REDUNDANCY - Data duplication SECURITY - Access levels/user limited to data MAINTENANCE - DBMS QBE - Query by example: Combines extracted data from several tables.

  1. Smart Card System

    The interpreter translates byte codes directly into program actions. 5.2.3 Debugger The Java debugger, jdb, enables the programmer to debug the Java classes. Unfortunately, the Java debugger is a throwback to the pre-GUI debugger dark ages of programming. However, it can use the jdb to set breakpoints, inspect objects and variables, and monitor threads.

  2. Data Modelling & Data Structures.

    Array: This is an ordering of the data elements so that the data is able to be extracted in a logical fashion, shown below is a diagram showing an example of this 1 6 9 3 Dim x (3) Index value 7 4 4 1 Dim y (3)

  1. Statistics - How good are people's memory considering different factors?

    words, and one for the pictures, and another sheet probably A5 size, to avoid material waste, will have spaces for the person to type in what he remembers. Projected or Presented? The pages that contain the numbers, words and pictures can be presented to the people who are being experimented upon, by two ways.

  2. AQA Computing CPT3

    displayPetrol Number 0 - 99.99 21.98 This stores the petrol dispensed total for the current transaction for the customers interface displayPetrol2 Number 0 - 99.99 27.39 This is a duplicate of the displayPetrol variable but for the cashier's console dispensedTotal Number 0 - 100,000 84,290 This displays the total of

  1. Creating a computer system for Wooten Basset Rugby Club

    1.4 Data Requirements From the interview it has become apparent that I will need to store a considerable amount of data. I have divided this data into the following groups: Players, Fixtures, Rivals, Rival Players, Players-Fixtures and Rival Players-Fixtures. A primary key will be used in every case to uniquely

  2. Definition-nature of the problem solved - Car Mechanic business

    bit more professional overall, and a computer system would probably accomplish this. Q: What type of information do you need to get relating to jobs that sometimes isn't available? If you mean things like how a certain car works and how to deal with certain problems then I usually just rely on instinct.

  • Over 160,000 pieces
    of student written work
  • Annotated by
    experienced teachers
  • Ideas and feedback to
    improve your own work