Data Structures

Edited by Jen Moreau

Ad

DATA STRUCTURES

The data structure is a systematic way to get data organize in other for effective use. Foundation terms in data structure;

  • Interface -"this illustrates and represents operations the data structure supports. An interface present only supported operation.
  • Implementation- it provides the definition of an algorithm employed in the operation of the structure.

CHARACTERISTICS OF DATA STRUCTURE

  • Space Complexity -" effective management of memory space.
  • Correctness -" the user interface should be well implemented
  • Time Complexity -" running and execution time should be as minimal

as possible

NEED FOR DATA STRUCTURE

  • Data search -" for fast and effective data search
  • Multiple Request -"
  • Processor Speed -" this might be less effective if the data grow above billions of record.

Data structure provides the solution to these needs. When data is well organized, required data or set of data can be searched almost instantly.

BASIC TERMINOLOGY

  • DATA -" Data value.
  • DATA ITEM -" refers to as single unit of values
  • GROUP ITEM- they are subdivided data items.
  • ELEMENTARY ITEM- a set of undivided data items.
  • ATTRIBUTE AND ENTITY -" a set of attributes or which may be assigned a value is called an entity.
  • ENTITY SET -" similar set of entities
  • FIELD- single elementary unit if information
  • RECORD -" collection of field values
  • FILE- collection of records in an entity set
Was this helpful? Yes | No | I need help

ENVIRONMENT SETUP

To set up your computer environment for C programming language, there is need for a text editor and the C Compiler

TEXT EDITOR

This main function is to type your program. Most common examples are Notepad++, windows notepad. Files created by this editor are called source file and mainly contained source codes.

THE C COMPILER

The compiler job is mainly to convert the program you write to machine language for the CPU to implement on. For compiling compiler such as C/C++

ALGORITHMS

The algorithm is a step by step procedure which defines the set of rules /instruction to be executed. An algorithm is independent of any language, it can be implemented in more programming. These are some important categories of an algorithm.

Was this helpful? Yes | No | I need help
  • Search: used to search an item
  • Sort: use to sort items in a specific order.
  • Insert: use to insert item
  • Update: use to update an existing item
  • Delete: use to delete an existing item

CHARACTERISTICS OF AN ALGORITHM

  • INPUT: there should be 0 0r a well-defined input
  • OUTPUT: there should be 1 or a well-defined output
  • UNAMBIGUOUS: it should be clear and have a unique output.
  • FINITENESS: Must terminate after finite steps
  • FEASIBILITY: should be feasible
  • INDEPENDENT: It should be independent of any program
Was this helpful? Yes | No | I need help

HOW TO WRITE AN ALGORITHM

The algorithm should follow step by step process. Example:

How to write Alg.PNG

Alternatively, the algorithm can be rewritten as thus

How to write Alg alt.PNG

With the second example, it becomes easy for the analyst to analyze the algorithm. A particular problem can be solved in more than one ways.

Alg Problem.PNG

ALGORITHM ANALYSIS

Efficiency of algorithm are analyzed either before implementation or after implementation,

  1. 1
    A Priori Analysis
    :
    in this form, the efficiency of a particular algorithm is determined by assuming that processor speed is constant and have no effect on the implementation.
    Advertisement
    Was this step helpful? Yes | No | I need help
  2. 2
    A Posterior Analysis
    :
    it is an empirical analysis where the selected algorithm is deployed using programming languages.
    Was this step helpful? Yes | No | I need help

ALGORITHM COMPLEXITY

  1. 1
    Time Factor
    :
    time is measured by counting the number of key operations.
    Was this step helpful? Yes | No | I need help
  2. 2
    Space Factor
    :
    it is measured by estimating the maximum memory space for the algorithm.
    Was this step helpful? Yes | No | I need help
    Advertisement

SPACE COMPLEXITY

This represents the total amount of memory space required in a life cycle by the algorithm. Space Complexity of any algorithm P is S(P) = C + SP(I)

Where S(P) = space complexity

C= fixed part

S(I) = variable of the algorithm

P = algorithm

An example is illustrated below,

Space complexity.PNG

Hence S(P) = 1+3

ASYMPTOTIC ANALYSIS

Asymptotic Analyse refers to defining mathematical framing of its run time performance. With this analyses, we can best decide which is the best case, worst case and an average case of an algorithm. For example, the running time of an operation F(n) maybe for another operation g(n2), similarly the running time of the two operations will be significantly same if n is small.

Was this helpful? Yes | No | I need help

Time required for an algorithm fall under these three categories

  • BEST CASE: Smallest time for program execution
  • AVERAGE CASE: Average required time for execution
  • WORST CASE: Maximum required time for execution

Referencing this Article

If you need to reference this article in your work, you can copy-paste the following depending on your required format:

APA (American Psychological Association)
Data Structures. (2017). In ScienceAid. Retrieved Jun 26, 2017, from https://scienceaid.net/Data_Structures

MLA (Modern Language Association) "Data Structures." ScienceAid, scienceaid.net/Data_Structures Accessed 26 Jun 2017.

Chicago / Turabian ScienceAid.net. "Data Structures." Accessed Jun 26, 2017. https://scienceaid.net/Data_Structures.

If you have problems with any of the steps in this article, please ask a question for more help, or post in the comments section below.

Comments

ScienceAid welcomes all comments. If you do not want to be anonymous, register or log in. It is free.

Article Info

Categories : Data Computer Science

Share this Article:

Thanks to all authors for creating a page that has been read 9 times.

Do you have a question not answered in this article?
Click here to ask one of the writers of this article
x

Thank Our Volunteer Authors.

Would you like to give back to the community by fixing a spelling mistake? Yes | No