Time And Space Complexity of Data Structure and Sorting Algorithms

Hey There,

Some algorithms are more efficient than others. We would prefer to chose an efficient algorithm, so it would be nice to have metrics for comparing algorithm efficiency.

The complexity of an algorithm is a function describing the efficiency of the algorithm in terms of the amount of data the algorithm must process. There are two main complexity measures of the efficiency of an algorithm:

1. Time complexity is a function describing the amount of time an algorithm takes in terms of the amount of input to the algorithm. In layman’s terms, We can say time complexity is sum of number of times each statements gets executed.

2. Space complexity is a function describing the amount of memory (space) an algorithm takes in terms of the amount of input to the algorithm. When we say “this algorithm takes constant extra space,” because the amount of extra memory needed doesn’t vary with the number of items processed.

Let’s take a look at Time And Space Complexity for Common Data Structure Operations and various Array Sorting Algorithms

Sorting Algorithms

Best of luck! If you liked this guide, feel free to forward it along! Please drop a mail with your comments info@gildacademy.in

Written by

Best Online and Offline Courses in Bangalore having classes for Data Structure and Algorithms, Python, C and Core Java Visit us @https://www.gildacademy.in/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade