Archives July 2018

Time & Space Complexity – II

Click here to go to the previous post. While calculating the space complexity of the algorithm, we established that one variable would take one unit of space. Space Complexity of Algorithm 2 Click here to view Algorithm 2. The easiest way to calculate the space complexity is to list out the variables and add 1

Read More


Time & Space Complexity – I

In simple words, time complexity is the amount of an algorithm takes to execute, and the space complexity is the memory used. In general, if you have ever studied the time and space complexity of algorithms, the one thing that we remember is: for loops are bad. In this first part of the series of

Read More


Sort an Array of Objects

Sorting of data is a common problem. Whenever we check something on the internet, be it clothes, flights, shoes, or any other item, the first thing (most of the time) we do is, sort the result. Each website provides sorting based on price, recommendations, popularity, and so on. So how do we sort data? There

Read More


What Changed with Arrow Functions

With the introduction of the arrow functions in JavaScript, everyone is happy. Well, why shouldn’t we be? It clears one of the biggest confusion in JavaScript. The confusion with the scope inside an event handler or a callback function, or to be precise scope within a scope. When ES6 was introduced, it removed the traditional

Read More