An algorithm is a step-by-step procedure for performing some tasks in a finite amount of time.

Data Structure on the other hand; is a systematic way of organizing and accessing data.

What are the steps for selecting a Data Structure best for solving problem?

  1. Analyze your problem to determine the basic operations that must be supported by data structure. (eg: inserting data, deleting data, or finding specific data).
  2. Quantify the resource constraints for each operation.
  3. Select the data structure that best meets requirements.

Basic Logarithmic Formulae:

How do you evaluate a Program’s Efficiency?

What is Time Complexity?

Time Complexity refers to the process of deriving estimates for the time needed to execute an algorithm (function of input). It is difficult to obtain an explicit formula for this function. An algorithm’s performance is the number of basic operations required to process an input of a certain size (denoted by n). Algorithm’s performance is proportional to the run time for that algorithm often expressed as a function “n” written as T(n}.

We group Time Complexity functions according to their growth, there are three different ways to this classification:

  1. Upper Bound (Big-O): cares only about worst-case scenarios, consider dominant terms [drop constants and lower order terms].
  2. Lower Bound (Omega): considers only the best-case scenarios
  3. Tight Bound (Theta):

How to calculate Time Complexity?

Examples for calculating Time Complexity: