Insertion sort is a simple sorting algorithm, it’s based on the idea that one element from the input elements is consumed in each iteration to find its correct position.

Image for post
Image for post

Even though it’s much less efficient on larger arrays than more advanced algorithms, it’s simple to implement and efficient on smaller data sets.

For our example, I’m going to be coding in JavaScript!

function insertionSort(arr) {  for(let startIdx = 0; startIdx < arr.length; startIdx++) {  }};
  • In our conditional, we are…

Selection Sort is a simple sorting algorithm. It’s an in-place comparison-based algorithm in which the list is dived into 2 parts, the sorted part at the left end and the unsorted part at the right end. Placing the smallest element in the array first in the sequence and gradually increase to the largest element at the end of the sequence.

Image for post
Image for post

Let’s say we have an array of random numbers, and you need them to sort them from smallest to largest:

  1. Bring it to the starting position
  2. And change the counter for unsorted array…

Sometimes you have to display a PDF file on your application, even though it’s a niche feature to do you may be lost. This is going to be a simple follow along, using a library from https://www.npmjs.com/package/react-pdf.

First, let’s import the library into our application.

npm install --save react-pdf

Then we have to import it into our component that we are rendering the PDF file. For my example I have a Resume component that I would like to render the PDF file.

import React from 'react'import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';const Resume = () => {  return…


GitHub: https://github.com/JoeG21/medium-ex/tree/master/react-searchbar/src

A search bar is such a simple feature that really elevate any application that you work on. While learning how to build a search bar from scratch, I found that most solutions use Class Components or render the whole application in one component. With our example I’m going to be using Functional Components and breaking down our application in multiple components.

For our example, we are going to be building this.

Image for post
Image for post

Whenever a user search for a name that she or he type in the search bar, it’s going to filter out the names. …


Docs: https://reactjs.org/docs/hooks-effect.html

GitHub: https://github.com/JoeG21/medium-ex/blob/master/react-hooks-useeffect/src/App.js

When learning hooks, useEffect is another important one to know and use in your application. Whenever we need some sort of side of effect to happen when we change our state then useEffect is perfect for that.

This is the same thing as using the lifecycle methods, like mounting and updating. But in a functional component, we don’t have access to those lifecycle methods. In order to get around this we use the useEffect hook

For our example we are going to build out this out.

Image for post
Image for post

First, we have to import useEffect from react like we…


Documentation: https://reactjs.org/docs/hooks-intro.html

GitHub: https://github.com/JoeG21/medium-ex/blob/master/react-hooks-useState/src/App.js

So after learning hooks, I understand why developers prefer them over Class Components. It’s much easier to main the state and of course update it. It’s nothing too hard to understand but can be somewhat confusing for first timers. I would recommend going back to old projects of yours and refactoring them into functional components.

There’s 2 things you need to know before incorporating hooks into your application. The 1st being, you can only use hooks in functional components. …


Image for post
Image for post

Without giving any real thought, flipping a card seem pretty simple. But like all things when it comes to doing it you may be lost on where to start. If your application uses cards and you need them to flip when a user click on them, then I hope my explanation can help you. For this example I’m going to be using a class component, however you can of course use a functional component and set state with hooks instead.

First thing we need to do is set state of a variable to a boolean value.


Depth-First Search is probably the fundamental graph traversal or tree traversal algorithm. It is used in many different questions including questions that seem like they’re unrelated to graphs, but can actually be turned into graph problems. We can think of it like a tree structure, and you have to traverse through its leafs (Nodes), find connections to other leafs, backtrack when you run out of paths, and repeat the process until all leafs are accounted for. These nodes can be any type of data, like Strings and Numbers.

Breadth-First Search is an algorithm for traversing or searching tree or graph…


A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component of a directed graph is a maximal strongly connected subgraph.

A graph is said to be strongly connected if every vertex is reachable from every other vertex.

Finding SCC

Image for post
Image for post

First we’ll depth-first, basically starting at a point and seeing what path it has to take. For this instance I started at A, in order for us to keep track we will simply put a number above the node we’re currently on. And go down a path that is reachable from said node…


Image for post
Image for post

Through out High School I always imagined my path was to graduate, dedicate more years of my life to school, and find a job. A very traditional path, but a path that I came to realize it wasn’t for me. I would have liked to say that after graduation I continue to educate myself, learn new skills, and achieve goals I set out for. Making myself sound smatter and successful but in reality I stuck in a loop. Wake up, work, eat, sleep, and repeat. An endless loop that seem to be unbreakable, and that’s because I was settling for…

Joe C Gomez

I’m a Software Engineer who is always learning something new!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store