filmov
tv
Algorithm Design and Analysis

Показать описание
What is Algorithm in general term?
- Defined steps to to achieve something.
For example, you want to make some dish at home, you are going to follow some recipe to make. Recipe is definitely some defined steps to
use the ingredients, spices and prepare final dish. That recipe is your algorithm to prepare that dish.
In Computer Science, algorithm is defined steps/guidelines to perform some action to achieve our development goal.
Why we study algorithms in computer science?
In order to make an algorithm, you need to perform certain actions like sorting, searching to get an intended output.
Every actions have different strategies to perform that action. Sorting have different strategies like Merge sort, Quick sort, Bubble sort etc.
To make an efficient algorithm, you need to choose the action strategies accordingly is all about algorithm in computer science.
Fundamental actions to apply on input data:
- Sorting: Sort your data [Merge sort, Quick sort etc.]
- Searching: Search the data [linear search , binary search etc.]
- Iteration: Looping through data until some condition you meet [for loop , while loop]
- Recursion: If you want to do same kind of operation repeatedly with previous outcomes [Fibonacci series, tree traversing etc.]
- Traversal: To visit the data of given inputs [Linear traversal, In tree in-order , pre-order , post-order]
- Dynamic Programming - optimization of recursive problems by storing some intermediate results which are repetitive.
To decide an algorithm for some coding problem
1. What is the problem? Input and Output?
2. What are the actions required to achieve that output?
3. What are the current available best strategies to do that action?
Complexity:
- Time Complexity: How fast your strategy is doing something.
- Space Complexity: How much extra memory your strategy consumes.
Related Video Reference:
Thanks,
CS Talks
#Algorithm #Coding #DataStructureAndAlgorithm #cstalks
- Defined steps to to achieve something.
For example, you want to make some dish at home, you are going to follow some recipe to make. Recipe is definitely some defined steps to
use the ingredients, spices and prepare final dish. That recipe is your algorithm to prepare that dish.
In Computer Science, algorithm is defined steps/guidelines to perform some action to achieve our development goal.
Why we study algorithms in computer science?
In order to make an algorithm, you need to perform certain actions like sorting, searching to get an intended output.
Every actions have different strategies to perform that action. Sorting have different strategies like Merge sort, Quick sort, Bubble sort etc.
To make an efficient algorithm, you need to choose the action strategies accordingly is all about algorithm in computer science.
Fundamental actions to apply on input data:
- Sorting: Sort your data [Merge sort, Quick sort etc.]
- Searching: Search the data [linear search , binary search etc.]
- Iteration: Looping through data until some condition you meet [for loop , while loop]
- Recursion: If you want to do same kind of operation repeatedly with previous outcomes [Fibonacci series, tree traversing etc.]
- Traversal: To visit the data of given inputs [Linear traversal, In tree in-order , pre-order , post-order]
- Dynamic Programming - optimization of recursive problems by storing some intermediate results which are repetitive.
To decide an algorithm for some coding problem
1. What is the problem? Input and Output?
2. What are the actions required to achieve that output?
3. What are the current available best strategies to do that action?
Complexity:
- Time Complexity: How fast your strategy is doing something.
- Space Complexity: How much extra memory your strategy consumes.
Related Video Reference:
Thanks,
CS Talks
#Algorithm #Coding #DataStructureAndAlgorithm #cstalks