What Are the Algorithms You Need to Know for Cs Recruiting
How to be Good at Algorithms?
My feel learning algorithms and data structures as a computer science undergraduate
If you lot want to get something done by a calculator, you have to tell the figurer how to practice it. Y'all accept to write a computer programme explaining step-by-step what tasks it has to do and how they should exist done. This is where algorithms come up into play.
Algorithms are a set of instructions used by computers to solve a given problem in society to meet an end goal.
In, my experience, learning algorithms is crucial to design and develop efficient computer programs. In this commodity, I would like to share with you my learning experience in algorithms every bit an undergraduate educatee and how it has benefitted me in my career and academic work.
Beginning Encounter
I started programming when I was in centre school and it was with Visual Basic, making calculators and traffic lite simulators. After on, I learned HTML and Java. Back then, I developed desktop applications and web applications. It was just merely coding and sometimes I had no idea nearly the underlying logic.
Afterwards inbound university and selecting Figurer Science and Engineering as my major, I got to learn about information structures and algorithms in my 2nd year. It was a compulsory course and everyone had to have it.
From Programmer to Software Engineer
The information structures and algorithms class was a turning point in my understanding of computer programming and it made me think more like a software engineer rather than a programmer. Why do I say and so? Let me give you some examples.
Example one: Sorting algorithms
Consider that we are making an online shopping application. We want to allow the users view items in the increasing guild of price. For this, we have to sort the items by the toll. As a novice developer, I would add the prices to an array (or list) with a record of their indices and simply call the array'southward in-built sort() method. What actually happens within the sort() method? I had no thought about the exact methods dorsum when I used to make applications.
Sorting algorithms are one of the basic topics taught at showtime in the data structures and algorithms course at university.
- Insertion sort
- Selection sort
- Quicksort
- Bubble sort
- Merge sort
After learning about the different sorting algorithms simply I realised that not every sorting algorithm is suitable for every task. They take 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 just a few seconds. Moreover, I got to learn about in-identify sorting algorithms (sort elements in identify) and out-of-identify sorting algorithms (require actress infinite to store elements while sorting). These things made me think in-depth on what sorting algorithms should I use for a specific application while considering the time and memory constraints.
Example 2: Parsing mathematical expressions
When we enter a mathematical expression into a estimator or into a prison cell in spreadsheet software such as MS Excel, information technology automatically gets evaluated and returns the states the answer. Have 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-1000 algorithm. It makes use of a queue to store values and a stack to store operators. I got to larn about real-world applications of the queue and stack data structures I had learned in the information structures and algorithms course, and understand the logic behind those choices. I felt and so proud of myself after implementing the shunting-1000 algorithm on my own, even though many implementations were already available. 😃
Example 3: Using lists, sets and dictionaries
Whenever I demand to store a bunch of values, I would use a list. Back and so, I did not intendance whether I demand to proceed the guild or to allow duplicates; I would simply use a listing for everything. Afterward I learned about lists, sets and dictionaries, I realised that these tin exist used in unlike scenarios, and using i over another would actually speed upwardly my code. For example, if I want to bank check for membership of a value, it is much faster in a set or lexicon (taking constant time) than when using a list (taking fourth dimension proportional to the length of the list). Moreover, a list allows y'all to keep duplicates while a ready will not allow duplicates.
These are a few of my experiences where I started to alter my thinking from a programmer to a software engineer. I have experienced significant improvements in the operation of my code when I changed to a suitable data structure or changed to a faster algorithm.
How to get started?
Larn Programming Concepts
Before learning algorithms in Informatics, I had a good understanding of programming concepts such as variables, functions, classes and especially, Object-Oriented Programming (OOP) concepts. These concepts act every bit a foundation to empathise more avant-garde concepts in information science.
Learn and Understand Algorithms and their Concepts
Apart from my course material, I followed our recommended textbook Introduction to Algorithms past Thomas H. Cormen, Charles E. Leiserson, Ronald Rivest and Clifford Stein. You can start with the nuts such as
- Fourth dimension and space complexity analysis
- Large O notation
- Recursion
- Bones data structures such as arrays, matrices, linked lists, stacks, queues, copse, etc.
- Basic algorithms such as searching algorithms and sorting algorithms.
Time and space complication analysis is a very important topic y'all have to understand in order to analyse algorithms. Then you can movement into more advanced algorithms such as graph algorithms.
The most important thing to keep in mind is that you have to clearly understand what happens within the algorithm. I used to take elementary examples and employ the algorithm to run across what happens in each step. Working out examples has helped me to get a ameliorate 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 chronicle to an instance and piece of work information technology out, rather than having to exactly memorise each step.
Become Your Hands Dirty with Lawmaking
During our form, we were asked to implement different data structures from scratch with their basic operations. I tin 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 grade and implement all these operations as functions. We were even asked to compare the running times of sure operations with unlike sizes of datasets. This was a cracking learning experience. I learned a lot from this practise and got a adept understanding of the operations. These kinds of experiential learning processes have helped me to grasp the concepts of algorithms meliorate.
You tin can start coding with languages that support OOP. I have found the following very easy to learn and code with.
- C++
- Java
- Python
If y'all are a beginner, I would recommend you to start with one of these languages.
Learning Resource
Online Courses
You tin follow online courses from
- Coursera: Algorithms Specialization, Data Structures and Algorithms Specialization, Algorithms, Part I, Algorithms, Office 2
- MIT Open Courseware: Introduction to Algorithms
- Khan Academy: Algorithms
- Udacity: Intro to Algorithms, Intro to Data Structures and Algorithms, Data Structures and Algorithms, Introduction to Graduate Algorithms, Computability, Complexity & Algorithms
- edX: Algorithms: Design and Analysis, Part i, Algorithms: Pattern and Analysis, Part 2, Algorithms and Data Structures, Algorithmic Blueprint and Techniques, Algorithm Blueprint and Analysis, Graph Algorithms
and many more platforms. You tin can endeavor the exercises provided to get a better understanding.
Interactive Algorithm Visualisers
You lot can try out algorithm visualising platforms such equally,
- Information Structure Visualization
- Algorithm Visualizer
- VisuAlgo
- Sorting Algorithms Animations | Toptal
- Animated Algorithms
- Algorithm Animations and Visualizations
that are available online and understand how algorithms piece of work step-by-step.
Programming Challenges
After agreement the basics, yous can practice what you have learned by 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 you proceed practising, the ameliorate you lot volition understand. Trying out programming challenges is a adept style to learn how the theories you have learned can be practical to solve problems.
Wrap Up
To wrap up this article, here are 10 tips I would similar to summarise based on my experiences while learning algorithms.
- Have a good understanding of the basics.
- Clearly sympathise what happens in an algorithm.
- Work out the steps of an algorithm with examples.
- Understand complexity analysis thoroughly.
- Try to implement the algorithms on your ain.
- Keep note of important things so you can refer subsequently.
- Follow online courses found on learning platforms.
- Follow online lectures published past reputed universities.
- Attempt out programming challenges.
- If you come across hard problems in programming challenges, do not get discouraged. You can read their tutorials and understand where yous got stuck after the challenge has ended.
Further Reading
If you would like to read more on data structures and algorithms you lot can cheque out the following articles.
Final Thoughts
Don't forget that,
Practice makes perfect!
Hope you establish this commodity useful and insightful. Permit me know your thoughts.
Thank you for reading!
Thanks!
Source: https://towardsdatascience.com/how-to-be-good-at-algorithms-bb1dd19ab54b
0 Response to "What Are the Algorithms You Need to Know for Cs Recruiting"
Post a Comment