Why Is Finding Complexity Of Algorithms Important In Practical Scenarios?

Ankita Katdare

Ankita Katdare

@abrakadabra Oct 10, 2024
The obvious answer that comes is for optimizing the algorithm. Complexity helps us determine how much time & space is utilized by the algorithm for execution.

Can someone share how complexity of algorithms helps in practical programming situations? Share examples.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Pensu

    Pensu

    @pensu-8tNeGU Dec 13, 2011

    Isn't it obvious. I mean you can make a program using 100kb space, but if it can produce same result in 80kb then its better as it saves space. Using the same thing you can say if a solution can provide the result in 80ms than a solution which generates the result in 100ms, the first one is better. We always want to save space and time, as both of them cost a lot...😉. I think a programmer should try to minimize both of them.
    I guess the main question is how to prioritize them, sometime a better time complexity needs more space. Now its tough decide where to compromise.