- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Algorithms and Complexities

## Algorithm

An algorithm is a finite set of instructions, those if followed, accomplishes a particular task. It is not language specific, we can use any language and symbols to represent instructions.

## The criteria of an algorithm

**Input:**Zero or more inputs are externally supplied to the algorithm.**Output:**At least one output is produced by an algorithm.**Definiteness:**Each instruction is clear and unambiguous.**Finiteness:**In an algorithm, it will be terminated after a finite number of steps for all different cases.**Effectiveness:**Each instruction must be very basic, so the purpose of those instructions must be very clear to us.

## Analysis of algorithms

Algorithm analysis is an important part of computational complexities. The complexity theory provides the theoretical estimates for the resources needed by an algorithm to solve any computational task. Analysis of the algorithm is the process of analyzing the problem-solving capability of the algorithm in terms of the time and size required (the size of memory for storage while implementation). However, the main concern of the analysis of the algorithm is the required time or performance.

## Complexities of an Algorithm

The complexity of an algorithm computes the amount of time and spaces required by an algorithm for an input of size (n). The complexity of an algorithm can be divided into two types. The **time complexity** and the **space complexity**.

## Time Complexity of an Algorithm

The time complexity is defined as the process of determining a formula for total time required towards the execution of that algorithm. This calculation is totally independent of implementation and programming language.

## Space Complexity of an Algorithm

Space complexity is defining as the process of defining a formula for prediction of how much memory space is required for the successful execution of the algorithm. The memory space is generally considered as the primary memory.

- Related Questions & Answers
- Graphs and its traversal algorithms
- Fixed and Flooding Routing algorithms
- What are the complexities MySQL joins involve?
- Rebalancing Algorithms
- What are the types of process scheduling algorithms and which algorithms lead to starvation?
- Difference between Deterministic and Non-deterministic Algorithms
- Sudoku Solving algorithms
- Adaptive Routing Algorithms
- Different Encryption Algorithms
- Difference between Adaptive and Non Adaptive routing algorithms
- What are cryptography, symmetric and public key algorithms?
- Introduction to Backtracking Algorithms
- Introduction to Searching Algorithms
- Introduction to Greedy Algorithms
- Introduction to Graph Algorithms