Data Structure and Algorithm

Basic Terminology:

Data: It is value or set of values.

Data item: It refers to single unit of values.

Group Items: Data items that are divided into sub items are called as group items.

Elementary Items: Data items that cannot be divided are called as Elementary Items.

Attribute and Entity: An entity is that which contains certain attributes or properties, which may be assigned values.

Entity set: Entities of similar attributes form an entity set.

Field : It is a single elementary unit of information representing an attribute of an entity.

Record: It is a collection of field values of a given entity.

File: It is a collection of records of the entities in a given entity set.



Algorithm:
Algorithm is a step-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output.
Following are some important categories:

  • Search: Algorithm to search an item in a data structure
  • Sort: Algorithm to sort item in a certain order
  • Insert: Algorithm to insert an item in a data structure
  • Update: Algorithm to update an existing item in a data structure
  • Delete: Algorithm to delete an existing item from a data structure
Characteristics of an Algorithm:

  • Unambiguous
  • Input
  • Output
  • Finiteness
  • Feasibility
  • Independent
Algorithm Analysis :
  1. A Priori Analysis
  2. A Posterior Analysis
Algorithm Complexity:
  • Time Factor
  • Space Factor


Data Structure:
Data Structures are the programmatic way of storing data so that data can be used efficiently. Almost every enterprise application uses various types of data structures in one or the other way.

Basic terms:

Data Definition:
It defines a particular data with the following characteristics.

  • Atomic: Definition should define a single concept.
  • Traceable: Definition should be able to be mapped to some data element.
  • Accurate: Definition should be unambiguous.
  • Clear and concise: Definition should be understandable.
Data Object:
Data object represents an object having a data.


Data Types:
It is a way to classify various types of data such as integer, string. Which determines the values that can be used with the corresponding type of data, the type of operations that can be performed on the corresponding type of data. It is of two types:
  1. Build-in Data Types[Integers, Boolean(true,false), floating(decimal numbers), characters and string]
  2. Derived Data Types[List, Array, Stack, Queue]
Basic Operations:
  • Traversing
  • Searching
  • Insertion
  • Merging
  • Deletion
  • Sorting
Characteristics of Data Structure:
  • Correctness
  • Time Complexity
  • Space Complexity
Need of Data Structure:
  • Data Search
  • Processor Speed
  • Multiple Requests
Execution time cases:
  • Worst case
  • Average case
  • Best case
top-algorithms-and-data-structures-for-competitive-programming


Comments

Popular posts from this blog

Centos