What Are Data Structures and Algorithms?
Overview
More precisely, a data structure is a collection of data values, the relationships among
them, and the functions or operations that can be applied to the data
Technically speaking, an algorithm is defined as a set of rules or a step-by-step
procedure that are to be executed in a specific order to get the desired output.
The formal definition of an algorithm is a finite set of steps carried out in a specific
time for specific problem-solving operations, especially by a Computer.
Algorithms are independent of programming languages and are usually represented by
using flowcharts or pseudocode.
Characteristics of an Algorithm
A fact to be noted is that not all sets of instructions or procedures are an algorithm. A
set of instructions should have all the relevant characteristics to qualify as an
algorithm.
The characteristics of algorithm are as follows-
      Unambiguous– An algorithm should be clear and simple in nature and lead to
       a meaningful outcome i.e. they should be unambiguous.
      Input– It should have some input values.
      Output– Every algorithm should have well-defined outputs
      Finiteness– The steps of an algorithm should be countable and it should
       terminate after the specified number of steps.
      Effectiveness– Each step of the algorithm should be effective and efficient
       enough to produce results. The effectiveness of an algorithm can be evaluated
       with the help of two important parameters-
      Time Complexity-It is nothing but the amount of time taken by the computer
       to run the algorithm. We can also call it the computational complexity of an
       algorithm. It can either be best-case, average-case or worst-case. We always
       aim for the best-case for effectiveness.
      Space Complexity-It refers to the amount of computational memory needed to
       solve an instance of the problem statement.The lower the space complexity of
       an algorithm, the faster the algorithm will work.
      Language Independent– Algorithms should be language independent. In other
       words, the algorithm should work for all programming languages and give the
       same output.
      Problem- The problem can be any real world or a programmable
       problem. The problem statement usually gives the programmer an idea
       of the issue at hand, the available resources and the motivation to come
       with a plan to solve it.
      Algorithm- After analysing the problem, the programmer designs the
       step by step procedure to solve the problem efficiently. This procedure
       is the algorithm.
      Input- The algorithm is designed and the relevant inputs are supplied.
      Processing Unit- The processing unit receives these inputs and
       processes them as per the designed algorithm
      Output- Finally, after the processing is complete, we receive the
       favourable output of our problem statement.
Why do we Need Algorithms?
Primarily, we need algorithms for the following two reasons-
      Scalability– When we have big real-world problems, we cannot tackle them on
       the macro level. We need to break them down into smaller steps so that the
       problem can be analyzed easily. Thus, algorithms facilitate scalability
      Performance– It is never easy to break down big problems into smaller
       modules. But algorithms help us achieve this. They help us make the problem
       feasible and provide efficient performance driven solutions