What is an algorithm in computer science ?-
You may have heard the term algorithm recently, whether it was online or perhaps in some conversation about technology. It's a word that gets thrown around a lot, but what does it mean exactly?
suppose your mom gave you a task to prepare a cup of tea for her. How do you prepare a cup of tea for her ?
definitely, to prepare a cup of tea you are gonna follow the following steps
2-Warm up teapot
3- Put the tea into a teapot and add hot water.
4-Cover teapot and steep tea
5-Strain tea solids and pour hot tea into tea cups.
Basically preparing tea was a problem and you follow some step-by-step procedures to solve this problem.
similarly, in computer science, An algorithm is simply a set of steps used to complete a specific task. They're the building blocks for programming, and they allow things like computers, smartphones, and websites to function and make decisions.
An algorithm is a specific procedure for solving a well-defined computational problem.
There might be multiple solutions to a problem that follow different steps or there might be multiple algorithms to solve a problem but we should use algorithms that take the least effort, time, and space.
to identify the efficiency of an algorithm we do space and time complexity analysis.