Jennifer Bland header image
≡ Menu

Hack Reactor Week 3 Review

After completing my 3rd week, I realized that I am one quarter of the way through my training at Hack Reactor. Unofficially next week I will have graduated from a Freshman to a Sophomore.

Week 3 is historically considered the hardest week at Hack Reactor. After just completing that week I can agree whole heartedly with that assessment.

Monday of Week 3 started with our self-assessment. We are giving a short time period to complete an assessment that tests our knowledge of the material covered in the previous week.

Our assessment this week was to:

  • Rewrite a function declaration into pseudo-classical
  • Write a function to find duplicate characters
  • Utilized several D3 functions
  • Describe time complexity of several algorithms

[continue reading…]

How Hoisting in JavaScript Can Cause Unexpected Results

Your can experience unexpected results in your JavaScript programs due to execution that does not occur like you expected. A good example of this is that you can actually use a variable in JavaScript before you declare it. Here is an example:

x = "Jennifer";
for (var i = 0; i < 10; i++) {
  console.log(i);
}

var x;

JavaScript allows this code to function due to a concept known as "hoisting." Hoisting the default behavior of a JavaScript application once it executes.

Within the current scope in a JavaScript application, all variables are "hoisted" to the top regardless of where they are declared.

[continue reading…]

Breadth First Search in JavaScript

In my previous post I discussed the difference between a graph data structure and a tree data structure. Now that you understand the difference between the two data structures, I am going to show you how you can search through your data.

The two most common methods of searching a graph or a tree are depth first search and breadth first search.

Whether to use a depth first search or a breadth first search should be determined by the type of data that is contained in your tree or graph data structure.

[continue reading…]

The Difference Between a Tree and a Graph Data Structure

In JavaScript programming, data can be stored in data structures like graphs and trees. Technically trees are graphs.

Graphs Data Structures

Graphs evolved from the field of mathematics. They are primarily used to describe a model that shows the route from one location to another location.

A graph consists of a set of nodes and a set of edges. An edge is a pair of nodes that are connected. A path is the term used to describe traveling between nodes that share an edge. The image below shows a graph with 3 nods and 3 edges.

graph data structure with 3 nodes and 3 edges

 

[continue reading…]

Hack Reactor Week 2 Review

Just completed my second week at Hack Reactor. The first hour of Monday was spent on completing a self assessment used to measure how well we learned the material covered in the first week. We were given 5 exercises that we had to complete in a 30 minutes.

The 5 exercises covered the major topics that were covered in our first week at Hack Reactor. Here are the exercises we had to complete:

  • Write a reduce function
  • Write two new methods that would extend the Array prototype
  • Describe differences between a stack and an array
  • Write a stack function
  • Write a function to handle collision in a hash table

[continue reading…]