DEV Community

Cover image for A Perfect Algorithm!

Posted on • Updated on

A Perfect Algorithm!

Post #02

algorithm is not just an approach to solve a problem but to solve them "efficiently". Efficiency here means, your code must be acceptable for minimum outcome of time and space factor

We write some codes to solve some logical problem and start calling it an "Algorithm" that's incomplete ๐Ÿ˜€

Ask yourself:

would you call something an algorithm which obviously let's you achieve some feature but eats all system resources ?

Well! I got some tips โคต๏ธ

1๏ธโƒฃ paper pen all steps you can think which leads the final output

2๏ธโƒฃ always follow networking OSPF method(open shortest path first)

3๏ธโƒฃ examine all steps you created and start re-examining all of them keeping "performance" in mind

4๏ธโƒฃ calculate how much time and space those steps require to perform one transaction successfully

5๏ธโƒฃ filter out best case, average case and worst case based on step 4 and go with "best case" always

And happy coding then ๐Ÿ˜€

You dont need special programming. you can use any programming language which you feel comfortable with

Thanks for reading ๐Ÿ˜Š

Top comments (5)

mccurcio profile image
Matt Curcio

Hey Mukul,
I am new to webdev and have a question for you.
Why is it a rule (or important) to OSPF (open shortest path first)?

slimdestro profile image
D\sTro • Edited

It's a common terminology of networking. LSR runs algorithm decides how many way it can be connected with nodes and what are the fastest route. A to c via b, b to d via a etc. Little confusing if you dont have prior experience with IP routing table

I mentioned this term to force approaching only the efficient path for building algorithm

soniarpit profile image


thomascoder48 profile image

Nice article

slimdestro profile image

Thanks a lot Thomas ๐Ÿค