- What is a Data Structure & Types of Data Structures
- What is an Algorithm & It's Characteristics
- Asymptotic Notations
- What is Space Complexity
- Array in Data Structure
- Algorithm for Insertion in Array
- Sparse Matrix
- Introduction to a Linked List
- Algorithm to Insert a Node at the End of the Linked list
- Algorithm to Insert a Node at the Front of the Linked List
- Algorithm to Delete a Node from Linked list
- Circular Linked List
- Algorithm to Insert a Node in the Circular Linked list
- Algorithm to Delete a Node from the Circular Linked list
- Doubly Linked List
- Algorithm to Insert a Node at the End of the Doubly Linked list
- Algorithm to Delete a Node from the Doubly Linked List
- Stack Data Structure
- Algorithm to convert Infix to Postfix
- Queue Data Structure
- Circular Queue in Data Structure
What is an Algorithm & It's Characteristics
An algorithm is a
set of well-defined instructions to solve a particular problem. It takes a set
of inputs and produces the desired output.
For example,
An algorithm to
multiply two numbers:
- Take
two number inputs
- Multiply
numbers using the * operator
- Display
the result
Characteristics of
an algorithm:
1. Inputs It should
take zero or more input.
2. Outputs: It should
produce at least one output.
3. Clear and
Unambiguous: The algorithm should be clear and unambiguous. Each of its steps
should be clear in all aspects and must lead to only one meaning.
4. Deterministic: It should be
deterministic means giving the same output for the same input case.
5. Finiteness: The algorithm
must be finite, i.e. it should terminate before a finite amount of time.
6. Feasible: The algorithm
must be simple, generic, and practical, such that it can be executed with the
available resources. It must not contain some future technology or anything.
7. Language
Independent: The Algorithm designed must be language-independent, i.e. it must
be just plain instructions that can be implemented in any language, and yet the
output will be the same, as expected.
8. Effectiveness: Every step in
the algorithm must be effective i.e. every step should do some work.