Do I Have To Learn Algorithms To Be A Be A Good Computer Programmer
How to be Good at Algorithms?
My experience learning algorithms and information structures as a informatics undergraduate
If you want to go something done by a estimator, you have to tell the computer how to practise it. You have to write a estimator program explaining stride-by-footstep what tasks it has to do and how they should be washed. This is where algorithms come into play.
Algorithms are a ready of instructions used by computers to solve a given trouble in order to meet an terminate goal.
In, my experience, learning algorithms is crucial to pattern and develop efficient computer programs. In this article, I would like to share with yous my learning experience in algorithms as an undergraduate student and how it has benefitted me in my career and academic work.
Showtime Encounter
I started programming when I was in center schoolhouse and it was with Visual Basic, making calculators and traffic light simulators. Later on, I learned HTML and Java. Back then, I adult desktop applications and web applications. It was just merely coding and sometimes I had no idea near the underlying logic.
After inbound university and selecting Figurer Science and Technology every bit my major, I got to learn about data structures and algorithms in my second year. It was a compulsory grade and everyone had to have information technology.
From Programmer to Software Engineer
The information structures and algorithms course was a turning point in my understanding of estimator programming and information technology made me retrieve more like a software engineer rather than a programmer. Why do I say so? Let me requite you some examples.
Example one: Sorting algorithms
Consider that we are making an online shopping application. Nosotros desire to let the users view items in the increasing order of price. For this, we have to sort the items by the price. As a novice programmer, I would add the prices to an assortment (or listing) with a record of their indices and merely call the assortment'southward in-congenital sort()
method. What actually happens inside the sort()
method? I had no idea near the exact methods back when I used to make applications.
Sorting algorithms are one of the basic topics taught at first in the data structures and algorithms course at university.
- Insertion sort
- Selection sort
- Quicksort
- Chimera sort
- Merge sort
Afterward learning about the different sorting algorithms only I realised that not every sorting algorithm is suitable for every task. They have different time complexities and they vary with the size of the data. Most of all, their running times matter a lot when developing applications, fifty-fifty though it is only a few seconds. Moreover, I got to acquire well-nigh in-place sorting algorithms (sort elements in place) and out-of-identify sorting algorithms (require extra space to store elements while sorting). These things made me think in-depth on what sorting algorithms should I utilize for a specific application while because the time and memory constraints.
Example 2: Parsing mathematical expressions
When we enter a mathematical expression into a computer or into a cell in spreadsheet software such as MS Excel, it automatically gets evaluated and returns the states the answer. Take you ever wondered how the expression gets evaluated? We had to develop a spreadsheet software and implement an expression parser. This is where I got to learn most the popular shunting-yard algorithm. Information technology makes apply of a queue to shop values and a stack to shop operators. I got to learn about real-world applications of the queue and stack data structures I had learned in the information structures and algorithms course, and sympathize the logic behind those choices. I felt and so proud of myself after implementing the shunting-yard algorithm on my ain, fifty-fifty though many implementations were already available. 😃
Example 3: Using lists, sets and dictionaries
Whenever I need to store a bunch of values, I would apply a listing. Back so, I did not care whether I need to keep the gild or to permit duplicates; I would simply use a list for everything. After I learned virtually lists, sets and dictionaries, I realised that these can be used in different scenarios, and using one over another would really speed up my code. For example, if I want to check for membership of a value, it is much faster in a set or dictionary (taking constant time) than when using a list (taking time proportional to the length of the listing). Moreover, a list allows you to keep duplicates while a set will not allow duplicates.
These are a few of my experiences where I started to modify my thinking from a programmer to a software engineer. I accept experienced meaning improvements in the operation of my code when I inverse to a suitable data structure or changed to a faster algorithm.
How to go started?
Acquire Programming Concepts
Before learning algorithms in Reckoner Science, I had a good agreement of programming concepts such as variables, functions, classes and especially, Object-Oriented Programming (OOP) concepts. These concepts human action as a foundation to empathise more avant-garde concepts in informatics.
Learn and Understand Algorithms and their Concepts
Apart from my class fabric, I followed our recommended textbook Introduction to Algorithms past Thomas H. Cormen, Charles E. Leiserson, Ronald Rivest and Clifford Stein. You tin start with the basics such as
- Time and space complexity analysis
- Large O notation
- Recursion
- Basic data structures such every bit arrays, matrices, linked lists, stacks, queues, trees, etc.
- Basic algorithms such equally searching algorithms and sorting algorithms.
Time and space complication assay is a very important topic yous have to empathize in lodge to analyse algorithms. And then yous tin can movement into more avant-garde algorithms such as graph algorithms.
The most important thing to go along in mind is that you accept to clearly understand what happens within the algorithm. I used to take elementary examples and use the algorithm to meet what happens in each step. Working out examples has helped me to go a meliorate understanding of what happens in the algorithm and I never had to memorise algorithms. If I'm asked to write a pseudocode for an algorithm I can easily relate to an case and work it out, rather than having to exactly memorise each step.
Get Your Hands Dirty with Lawmaking
During our course, we were asked to implement different data structures from scratch with their bones operations. I can remember implementing binary search trees (BST) in C++ with the operations insert, delete, search, preorder traversal, postorder traversal and inorder traversal. Nosotros had to make a BST class and implement all these operations as functions. We were even asked to compare the running times of certain operations with different sizes of datasets. This was a dandy learning experience. I learned a lot from this exercise and got a good agreement of the operations. These kinds of experiential learning processes have helped me to grasp the concepts of algorithms better.
Yous tin can start coding with languages that support OOP. I have found the post-obit very easy to learn and code with.
- C++
- Coffee
- Python
If you are a beginner, I would recommend you to kickoff with one of these languages.
Learning Resources
Online Courses
Y'all tin can follow online courses from
- Coursera: Algorithms Specialization, Data Structures and Algorithms Specialization, Algorithms, Part I, Algorithms, Part Ii
- MIT Open Courseware: Introduction to Algorithms
- Khan Academy: Algorithms
- Udacity: Intro to Algorithms, Intro to Information Structures and Algorithms, Data Structures and Algorithms, Introduction to Graduate Algorithms, Computability, Complexity & Algorithms
- edX: Algorithms: Pattern and Analysis, Function 1, Algorithms: Design and Analysis, Office 2, Algorithms and Data Structures, Algorithmic Design and Techniques, Algorithm Design and Analysis, Graph Algorithms
and many more than platforms. Y'all can endeavour the exercises provided to get a meliorate understanding.
Interactive Algorithm Visualisers
Y'all can try out algorithm visualising platforms such as,
- Information Structure Visualization
- Algorithm Visualizer
- VisuAlgo
- Sorting Algorithms Animations | Toptal
- Animated Algorithms
- Algorithm Animations and Visualizations
that are available online and sympathise how algorithms work step-by-stride.
Programming Challenges
After understanding the nuts, yous can practice what you have learned past trying out programming challenges. The following platforms provide very good challenges ranging from different difficulty levels.
- Project Euler
- HackerRank
- CodeChef
- Coderbyte
- Exercism
- Codewars
- LeetCode
The more yous keep practising, the better you will understand. Trying out programming challenges is a good way to learn how the theories yous accept learned can be applied to solve problems.
Wrap Up
To wrap up this article, here are x tips I would like to summarise based on my experiences while learning algorithms.
- Take a good agreement of the nuts.
- Conspicuously sympathise what happens in an algorithm.
- Piece of work out the steps of an algorithm with examples.
- Sympathise complication analysis thoroughly.
- Try to implement the algorithms on your own.
- Keep note of important things so y'all can refer afterward.
- Follow online courses found on learning platforms.
- Follow online lectures published by reputed universities.
- Try out programming challenges.
- If yous run across hard issues in programming challenges, do not go discouraged. You tin can read their tutorials and empathize where you got stuck later on the claiming has ended.
Further Reading
If you lot would similar to read more on data structures and algorithms you can check out the following articles.
Final Thoughts
Don't forget that,
Do makes perfect!
Hope you found this article useful and insightful. Let me know your thoughts.
Cheers for reading!
Cheers!
Source: https://towardsdatascience.com/how-to-be-good-at-algorithms-bb1dd19ab54b
Posted by: rodgersalsoned.blogspot.com
0 Response to "Do I Have To Learn Algorithms To Be A Be A Good Computer Programmer"
Post a Comment