Book Image

Hands-On Data Structures and Algorithms with JavaScript

By : Kashyap Mukkamala
Book Image

Hands-On Data Structures and Algorithms with JavaScript

By: Kashyap Mukkamala

Overview of this book

Data structures and algorithms are the fundamental building blocks of computer programming. They are critical to any problem, provide a complete solution, and act like reusable code. Using appropriate data structures and having a good understanding of algorithm analysis are key in JavaScript to solving crises and ensuring your application is less prone to errors. Do you want to build applications that are high-performing and fast? Are you looking for complete solutions to implement complex data structures and algorithms in a practical way? If either of these questions rings a bell, then this book is for you! You'll start by building stacks and understanding performance and memory implications. You will learn how to pick the right type of queue for the application. You will then use sets, maps, trees, and graphs to simplify complex applications. You will learn to implement different types of sorting algorithm before gradually calculating and analyzing space and time complexity. Finally, you'll increase the performance of your application using micro optimizations and memory management. By the end of the book you will have gained the skills and expertise necessary to create and employ various data structures in a way that is demanded by your project or use case.
Table of Contents (16 chapters)
Title Page
Copyright and Credits
PacktPub.com
Contributors
Preface
5
Simplify Complex Applications Using Graphs
Index

Creating a credit card approval predictor


Trees are ubiquitous. No matter what application you are using, chances are that there are trees in play internally. Having said that, not all trees are data structures. In this example, we will explore something different, which is a really popular but not a typical data structure, that is, a decision tree.

At some stage, you would have come across some sort of an automatic prediction system. Whether it is a sports website that predicts the winner of a game or credit scoring websites that tell you which credit card you should apply for to get a quick approval. In this example, we will go with a credit card approval predictor, but this can be easily transferred to any application of your choice.

In a majority of the cases, we have a complex Machine Learning model running behind the scenes to generate an accurate prediction, but, because we know that the number of factors affecting the approval or rejection is finite, we can use a decision tree to determine...