Understanding Data Structures and Algorithms.

As a developer, data structures and algorithms are one of the most essential topics you must understand to do well in any given project or just generally while writing code. In a former article, I already explained that understanding data structures and algorithms is very important in order to remain relevant in the fourth industrial revolution, you can check it out here:

adetolajesulayomi.substack.com/p/a-software..

Most technical interviews centers on the knowledge of data structures and algorithm, so for you to ace your interview, you must know the basics of data structures and algorithms.

But why is there so much attention or focus on the knowledge of data structures and algorithms? Well, this is simply because their understanding improves the developer's problem-solving ability by a great length.

What is Data structure?

The data structure is a named location which can be used to store and organize data. Computer problems which can be solved using data structures include: Fibonacci number series, Tower of Hanoi, Project scheduling, Knapsack problems etc.

What is Algorithm?

An algorithm is a series of steps to solve a specific problem. The important categories of algorithms are:

Search - algorithm to search an item in a data structure.

Sort - Algorithm to sort items in a certain order.

Insert − Algorithm to insert an item in a data structure.

Update − Algorithm to update an existing item in a data structure.

Delete − Algorithm to delete an existing item from a data structure.

I will quickly explain the Big O Notation as you might come across it in your study. The Big O notation is an asymptotic analysis that describes how long an algorithm takes to execute. Simply, it is used to talk about how complex an algorithm is.

Below are basics of important data structures that are tested during technical interviews :

Array

Array is a collection of items of the same variable type that are stored in a sequential manner in computer memory.

Every item in an array starts with an index 0 but for Java, the size of an array cannot be changed.

Linked Lists

This is a linear sequence of nodes that are linked together, it implements collections and Iterable interface as well, every node. There is always a value and a pointer to the next node in the list. The first node is called the Head while the last node is called the Tail.

Useful applications for a linked list will be to create directories, implement stacks, dynamic memory allocation etc.

Stacks

Stacks are linear data structures in a last-in, first-out (LIFO) order. The simple logic is this, the last value you add is the first one you remove. The common functions in a stack are; push(to insert objects), pop(to consume elements from the top), isEmpty and peek.

Queues

While Stacks are in the LIFO order, queues are in the FIFO order(first-in, first-out). In Queues, elements enter from the “back” and leave from the “front". The functions in Queues include enqueue, dequeue, rear, front, and isFull.

Hash table

The hash table also known as the map or dictionary. A hash table is implemented by storing elements in an array and identifying them through a key, so anytime you input the key into the hash function , it will always return the same index.

Awesome books you should read on Data structures and algorithms:

Introduction to Algorithms by Thomas H. Corman

Algorithms by Robert Sedgewick & Kevin Wayne

The Algorithm Design Manual by Steve S. Skiena

Algorithm for Interviews

Algorithm in Nutshell

Courses to learn data structures and algorithms:

Data Structures & Algorithms with Java - Interview !! From Udemy

Algorithms and Data Structures - Part 1. From Pluralsight

Data Structures and Algorithms. From Coursera

Object-Oriented Java Programming: Data Structures and Beyond Specialization. From Cousera