Why Algorithm

Problem solving is not all about getting the right result, writing an algorithm that solves a problem but requires a year is hardly of any use, likewise, an algorithm that requires several gigabytes go main memory is not (currently) useful on most machine. When solving a problem we need to consider several resources such as time and memory space before choosing the logic to use, this is where knowing the exact algorithm to use come in.

There have been several arguments on which to learn first, algorithms (and data structure) or programming languages or is there even a need to learn/study algorithm at all. This write up will cover why you should study algorithm and data structure .


Network connectivity problem:-

“ Given a large set of items that are connected to another pair wise is there a way to get from one part to another. as you can see from the diagram above its not clear if there is a solution or not”  

Most self learnt programmer jump straight into development without having the fundamental knowledge of how exactly some logic works. Programming is all about applying logic to solving problems. An algorithm represents your solution to a programming problem, algorithm which are methods for solving problems. While you may not implements some of the algorithm everyday, the knowledge will sharpen your approach to problem solving. Apart from learning algorithm for fundamentals , there are also tons of other reasons why you should study algorithms, the impact is very broad , far reaching and also helps in intellectual stimulations

For me , great algorithm are the poetry of computation, just like verse, they can be terse, allusive, dense, and even mysterious . But once unlocked, they cast a brilliant new light on some aspect of computing -- Francis sullivan
An algorithm must be seen to be believed -- Donald Knuth
I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important . Bad programmers worry about the code. God programmers worry about data structures and their relationships -- Linus Torvalds ( Creator of Linux)
Algorithms + Datat structures = Programs  -- Niklaus Wirth

There will often be limited resources when solving a problem so Writing the perfect and efficient login/solution to a problem requires the right set of data structure and algorithms, Because there are always several ways to solve a program , but not all the method are good and efficient. 

If you want to become a master programming, then learning how to write great algorithms is a must. You can start learning algorithms without prior knowledge of any programming language but to be able to implement them you would need to learn at least one programming language. 

Here are few topics you should look into to become an algorithm expert 
Data types: stack, queue, bag, union-find, priority queue
Sorting: sorting quicksort, mergesort, heapsort and radix sorts
Searching: Binary search tree, red-black tree, hash table
Graphs: Breath first search, DFS, prim, kruskal, Dijkstra
Strings: KMP, regular expression . TST, Huffman, LZW
Advance: B-tree, suffix array, maxflow

Recommended Books :

2 comments