Introductions to Data Structure and Algorithms
What are Data Structures
Data is a collection of number of Alphabates, Digits and Special symbols.
When we combine such type of data together, it represents an information. Computer takes input in the form of row data, process it and gives predefined data as a output.
Classification of data Structures
Data Structure is divided into 2 categories :
- Primitive Data Structure
- Non-primitive Data Structure
- Primitive Data Structure
The objects of primitive data type can be operated by machine level instruction.
Ex. char, int, float, pointer.
- Non-Primitive Data Structure
These are the data structures created from primitive data structures.
Ex. array, structure, file, union, list.

Operations on Data Structure
We can perform various different operations on data structure.
- Searching : To find the location/position of a specific data from the given data structure.
- Insertion : To insert the new data in the old data structure.
- Deletion : To remove existing data from the data structure.
- Sorting : Arranging the data in some logical order .
- Traversing : To access each data only once.
- Merging : It means, combine two similar data structures together.
Algorithm
An algorithm is a finite set of instructions to solve any specific problem. These steps are performed on a data representing instance of problem.
Every algorithm gets a input and gives required output by performing sequence of operations on it.
Every algorithm has various properties such as :
- Input: Accept one or more input data.
- Output: Give desired one or more result.
- Finiteness: Every algorithm must terminate after finite number of steps.
- Definiteness: Each step should be clear and unambigous (non repeating).
- Effectiveness: Each step of algorithm should be written using basic instructions.
There are two different methods for designing an algorithm :
- Top-down approch : It is based ion decomposing a large problem into sub-problems and repeat this process till output is not generated.
Ex. C language. - Bottom-up approch : It is opposite to top-down, means different parts of problems are solved firstly using a programming language and then these parts are combine into complex problem.
Ex. C++.
Comments
Post a Comment