nguyenlan13.github.io


Hash Tables

Hash tables are a very interesting and useful data structure in that they can provide very fast lookups and insertions. Hash tables can go by different names in different languages. For example, in Ruby it is called a hash and in Javascript it is called an object.


Bubble Sort

Bubble sort has a notorious reputation for being a “bad” sorting algorithm due to its poor performance. An illustration of how this algorithm compares to other sorting algorithms can be seen here. The bubble sort algorithm iterates through a collection and compares each element one at a time to the element adjacent to it, swapping the elements if it is out of order. This continues until all the elements are sorted. The smallest element “bubbles” towards the front and the largest “bubbles” towards the end.


Big-O Simplified

When analyzing the performance of an algorithm, the term big-O notation typically appears. What is big-O? Big-O is the metric used to describe the efficiency of an algorithm, usually in terms of time(runtime) or space (memory) complexity. It describes the asymptotic upper bound(growth of time or space) of an algorithm as input size grows.


React Hooks

With the addition of React hooks, functional components could now use state and mimic the functionality of lifecycle hooks which were previously only available to class components. Hooks were added to the React library in v16.8. Two popular and widely used built in hooks are useState and useEffect. The useState() hook makes it possible to add local state to a functional component and can be called multiple times in the same component. This function returns a pair, the current state and a function to update the current state. It is comparable to this.setState in a class component except the old and new state is not merged together. An example of a sign up form using hooks is below:


Build your toolSet

This application was built utilizing a Ruby on Rails backend with session cookies for API authentication, PostgreSQL database, and a React with Redux frontend.