...

Not sure which course is right for you?

Algorithms and Data Structures Every Programmer Should Know

Written by: App Academy
Published on: March 13, 2024
nan

If you want to become a software engineer, but don’t know where to start, let’s save you the suspense: It’s algorithms and data structures.

Once you get the gist of these pillars of programming, you’ll start seeing them everywhere. And the more algorithms and data structures you learn, the more they’ll serve as jet fuel for your career as a software engineer.

To get you started, let’s first take a deep dive into Search and Sort, two classes of algorithms you can’t live without. Then let’s do a quick survey of the rest of the landscape that includes trees, graphs, dynamic programming and tons more.

SEARCHING

Roughly speaking, there are two categories of search algorithms you’ll need to know right away: linear and binary. Depth First Search (DFS) and Breadth First Search (BFS) are also super-important, but we’ll save them for the graph traversal section below.

LINEAR SEARCH

The linear and binary algorithms are named as such to describe how long (time complexity) a search is going to take based on the size of the input that is being search.

For example, with linear search algorithms, if you have 100 items to search then the worst case scenario would require that you look at every item in the input before you came across your desired value. It is called linear because the time is takes to search is exactly correlated with the amount of items in the search (100 items/input =100 checks/complexity)

In short, linear = simple (there is nothing clever about the algorithm). For example: imagine you’re trying find your friend Lin among a line of people standing in no particular order. You already know what Lin looks like, so you simply have to look at each person, one by one, in sequence, until you recognize or fail to recognize Lin. That’s it. In doing so, you are following the linear search algorithm

BINARY SEARCH

Binary search gets its name because the word binary means of or relating to 2 things” and the algorithm works by splitting the input into two parts until it finds the item that is being searched. One half contains the search item and the other half doesn’t. The process continues until the spot where the input is split becomes the item that is being searched. Binary search is basically just a highly disciplined approach to the process of elimination. It’s faster than linear search

Don’t miss a beat with The Cohort!

We’ll send you the latest Tech industry news, SWE career tips and student stories each month.

You can unsubscribe at any time. View our Privacy Policy.

Interested in an App Academy Bootcamp?

One of our coding bootcamps, prep course or free online coding platform (App Academy Open) could be the next step you need to make a lasting career change!

 

You Might Also Like

If you enjoyed this article, we encourage you to read some of our other top posts.