• Stars
    star
    903
  • Rank 50,580 (Top 1.0 %)
  • Language
    JavaScript
  • Created about 1 year ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Challenges & docs from JS Algorithms & Data Structures course

Traversy JS Challenges: Data Structures & Algorithms

This is the sandbox for my 70+ JS Challenges: Data Structures & Algorithms Course. Just about all of the concepts that are included, also exist in other languages. So, if you are not a JavaScript developer, you can still follow along and learn from this course/repo.

This course/repo goes over everything from basic loop challenges, high order array methods, recursion, time & space complexity, data structures such as stacks, queues, linked lists, trees, graphs, and we touch on sorting algorithms like bubble sort, insertion and merge sort. You should already know the basics of JavaScript before doing any of the challenges or taking the course.

Please do not make any PRs to this repo as it goes along with a specific course. I may open another one for student solutions and new challenges.

File Structure

Each folder includes:

  • readme.md - The challenge/code instructions. This also includes hints, tests and a dropdown with the solution code as well as the explanation of the solution code.
  • [name].js - This is your working file. It has the name of the function and the function is exported. No parameters are passed to the function. That is up to you to add.
  • [name]-run.js - File to run the code manually. The function is already imported and called with expected parameters.
  • [name]-solution.js The solution code with heavy commenting. Some challenges have multiple solutions. If you want the solution without comments, look in the readme.md file.
  • [name]-test.js - Jest tests for the solution code. You will need to rename this file to [name].test.js to run the tests.

Learning Modules/Lessons

Some lessons/modules are not challenges, they are more like mini-lessons. I don't just throw you a challenge using a new concept (Trees, Stacks, Bubble Sorts, etc) without explaining it first. I try to explain the concept and then give you a challenge to practice or implement it. So some folders will not have a challenge, just a readme file.

Running Tests

In order for the Jest tests to run, you need to rename the test file to [name].test.js. For example, if you are working on the hello-world challenge, you need to rename the hello-world-test.js file to hello-world.test.js. This is because Jest looks for files with the .test.js extension.

Run the command npm run test from the root directory and it will run all the tests.

These Don't Have to be "Challenges"

Some people, such as myself are not great at doing this stuff off the top of their head. Even though most of the code is setup as a challenge, you can certainly just follow along with the course and/or just study the solutions and learn from them.

You can use the tests to see if your code passes, but use the run files to run the code manually. This is so that you can experiment, console.log, etc.

Getting Started

  1. Clone the repo
  2. Run npm install
  3. Run npm run test to run the tests. Again, you will need to rename the test files and replace the -test with .test to run the tests.

Index of Challenges/Lessons

01. Basic Challenges 1

These are mostly challenges that have to do with loops, conditionals, and string manipulation. I do not go over fundamentals like "what is a for loop". You should already know the basics of JavaScript.

  1. Hello World Test Challenge
  2. Get Sum Test Challenge
  3. Calculator
  4. Count Occurrences
  5. Find Max Number
  6. Title Case
  7. Reverse String
  8. Palindrome
  9. Count Vowels
  10. Remove Duplicates

02. Basic Challenges 2

These are more challenges that have to do with iteration. They are slightly harder than the first set of challenges.

  1. FizzBuzz Array
  2. Array Intersection
  3. Display Likes
  4. Find Missing Number
  5. Find Missing Letter
  6. Are All Characters Unique
  7. First Non-Repeating Character
  8. Dice Game Simulation
  9. Format Phone Number
  10. Validate Email

03. High Order Array Methods

The next set of challenges/lessons will have to do with high order array methods such as map, filter, reduce, sort, etc. Even though most of these can be done with a for loop, I want you to practice using these methods.

  1. Simple Examples
  2. Sum Of Even Squares
  3. Calculate Total Sales
  4. Highest Scoring Word
  5. Valid Anagrams
  6. HashTag Generator
  7. Valid IPv4 Address
  8. Analyze Car Milage
  9. Password Validator
  10. Find Missing Letter Refactor

04. Recursion

The next batch of challenges/lessons will have to do with recursion. We will first talk about what recursion is and then we can look at some challenges.

  1. Recursion Intro (Count Down)
  2. Unwinding (Sum Up To)
  3. Reverse String Recursion
  4. Fibonacci Sequence
  5. Factorial
  6. Power
  7. Array Sum
  8. Number Range
  9. Flatten Array
  10. Permutations

05. Complexity

This is more of a learning section than a challenge section. We will talk about Big O notation and how to calculate the time complexity of an algorithm. We will also talk about space complexity and how to calculate that as well. We will talk about the different types of complexity such as constant, linear, quadratic, etc.

  1. What Is Time Complexity?
  2. Big O Notation
  3. Constant Time Complexity
  4. Linear Time Complexity
  5. Quadratic Time Complexity
  6. Logarithmic Time Complexity
  7. Space Complexity
  8. Max Subarray Quadratic
  9. Sliding Window Technique
  10. Space Complexity

06. Hash Tables, Maps & Sets

In this section, we will start to look at data structures. We will start with a data structure called a hash table. This will include maps and sets, which are built-in JavaScript data structures that are similar to hash tables. We will also create a custom hash table class and use it in a couple challenges.

  1. What Are Data Structures?
  2. Hash Table Intro
  3. Maps
  4. Word Frequency Counter
  5. Phone Number Directory
  6. Anagram Grouping
  7. Sets
  8. Symmetric Difference
  9. Two Sum
  10. Longest Consecutive
  11. Custom Hash Table
  12. Word Instance Counter
  13. Add getValues() Method
  14. Add getValues() Method

07. Stacks, Queues & Linked Lists

In this section, we will look at working with data structures such as stacks, queues, and linked lists. We will also look at fast and slow pointers.

  1. What Is A Stack?
  2. Stack Implementation
  3. Reverse String With Stack
  4. Balanced Parentheses
  5. What Is A Queue?
  6. Queue Implementation
  7. Reverse String With Queue
  8. Palindrome With Queue & Stack
  9. What Is A Linked List?
  10. Linked List Implementation
  11. Reverse String With Linked List
  12. Fast & Slow Pointers
  13. Find Middle
  14. What Is A Doubly Linked List?
  15. Doubly Linked List Implementation
  16. Find Pair Sum

08. Binary Trees & Binary Search Trees & Graphs

In this section, we will look at trees and graphs. We will start with binary trees and binary search trees. We will also look at graphs and graph traversal.

  1. What Is A Tree?
  2. Tree Node Class
  3. Depth First Traversal
  4. Depth First Traversal Recursive
  5. Breadth First Traversal
  6. Maximum Depth
  7. What Is A Binary Search Tree?
  8. Binary Search Tree Implementation
  9. Validate BST
  10. What is a Graph?
  11. Adjacency Matrix & Adjacency List
  12. Graph Implementation
  13. Graph Traversal
  14. Graph Depth First Traversal
  15. Graph Breadth First Traversal

09. Sorting Algorithms

In this section, we will get into sorting algorithms. We will start with bubble sort, which is very popular in interviews. We will also look at selection sort, insertion sort, merge sort, and quick sort.

  1. What Are Sorting Algorithms?
  2. Bubble Sort Algorithm
  3. Bubble Sort Implementation
  4. Insertion Sort Algorithm
  5. Insertion Sort Implementation
  6. Selection Sort Algorithm
  7. Selection Sort Implementation
  8. Merge Sort Algorithm
  9. Merge Sort Implementation
  10. Quick Sort Algorithm
  11. Quick Sort Implementation

More Repositories

1

design-resources-for-developers

Curated list of design and UI resources from stock photos, web templates, CSS frameworks, UI libraries, tools and much more
58,625
star
2

50projects50days

50+ mini web projects using HTML, CSS & JS
CSS
36,264
star
3

vanillawebprojects

Mini projects built with HTML5, CSS & JavaScript. No frameworks or libraries
JavaScript
15,520
star
4

proshop_mern

Shopping cart built with MERN & Redux
JavaScript
1,995
star
5

devconnector_2.0

Social network for developers, built on the MERN stack
JavaScript
1,907
star
6

node_passport_login

Node.js login, registration and access control using Express and Passport
JavaScript
1,695
star
7

react-crash-2021

Task tracking application from the React crash course
JavaScript
1,359
star
8

chatcord

Realtime chat app with rooms
HTML
1,161
star
9

modern_js_udemy_projects

Project files for Modern JS From The Beginning course
JavaScript
1,121
star
10

react_express_starter

Starter pack for React and Express full stack development
JavaScript
774
star
11

mern-tutorial

Goalsetter application from Youtube series
JavaScript
710
star
12

modern_portfolio

Responsive portfolio website
SCSS
681
star
13

laragigs

Laravel job listing app
PHP
606
star
14

loruki-website

Cloud hosting website
HTML
595
star
15

mern_shopping_list

Shopping List built with MERN and Redux
TypeScript
594
star
16

lead_manager_react_django

Full stack app with React, Redux & Django
JavaScript
590
star
17

proshop-v2

ProShop ecommerce website built with MERN & Redux Toolkit
JavaScript
584
star
18

php-crash

Code for my PHP crash course on YouTube
PHP
572
star
19

storybooks

Node.js app with Google OAuth
JavaScript
561
star
20

feedback-app

React feedback app from React course
JavaScript
542
star
21

vue-crash-2021

Task Tracker project from youtube crash course
Vue
536
star
22

devcamper-api

Backend for devcamper app
HTML
516
star
23

btre_project

Django real estate website
CSS
507
star
24

tailwind-landing-page

CSS
500
star
25

javascript_cardio

JavaScript challenges and problems
JavaScript
490
star
26

expense-tracker-react

Simple expense tracker using React hooks & context
JavaScript
485
star
27

ui_components

Collection of HTML & CSS UI components
HTML
484
star
28

python_sandbox

Files to learn Python basics
Python
483
star
29

angular-crash-2021

Task tracker app from the 2021 youtube crash course
TypeScript
480
star
30

simple_react_pagination

Frontend pagination with React
JavaScript
479
star
31

vanilla-parcel-boilerplate

Simple starter workflow for building vanilla js apps with Parcel
JavaScript
436
star
32

next-crash-course

Project from my Next.js crash course on YouTube
JavaScript
425
star
33

tailwind-course-projects

Projects from my TailwindCSS course
CSS
425
star
34

redux_crash_course

Simple implementation of Redux with React 16
JavaScript
416
star
35

node_crash_course

Files for YouTube crash course
JavaScript
401
star
36

bootstrap-bootcamp-website

HTML
390
star
37

react_crash_todo

React crash course files
JavaScript
373
star
38

javascript-sandbox

Sandbox from the Modern JS From The Beginning 2.0 course
JavaScript
372
star
39

github-finder

Search Github users - React hooks & context
JavaScript
372
star
40

expense-tracker-mern

Full stack expense tracker
JavaScript
368
star
41

vanilla-node-rest-api

REST API using Node.js without a framework
JavaScript
368
star
42

rust_sandbox

Fundamentals of the Rust language
Rust
358
star
43

express_crash_course

Express crash course on YouTube
JavaScript
358
star
44

docker-node-mongo

Sample node and mongo app that uses docker
JavaScript
357
star
45

vue_crash_todolist

Vue crash course application
Vue
351
star
46

project-mgmt-graphql

Full stack GraphQL, Express & React app
JavaScript
339
star
47

webpack-starter

Boilerplate for Webpack apps
JavaScript
337
star
48

github-finder-app

Find github users and display their info
JavaScript
336
star
49

react_redux_express_starter

Boiler plate for React/Redux applications with Express
JavaScript
336
star
50

lsapp

Laravel from scratch website/blog application
PHP
333
star
51

contact-keeper

Contact manager using React hooks & context
JavaScript
327
star
52

dj-events-frontend

Next.js website to list DJ and other musical events
JavaScript
324
star
53

vuex_todo_manager

Vuex crah course app
Vue
314
star
54

myflaskapp

Python Flask app with authentication
Python
312
star
55

house-marketplace

House marketplace built with React and FIrebase
JavaScript
311
star
56

hulu-webpage-clone

Hulu webpage clone
CSS
307
star
57

nodejs-openai-image

Web app that uses Node.js and OpenAI to generate images
CSS
305
star
58

nodekb

Simple knowledgebase app with Node.js, Express and MongoDB
JavaScript
303
star
59

react_step_form

Multi step form built with React and Material UI
JavaScript
302
star
60

axios-crash

Axios crash course files
JavaScript
298
star
61

mern-auth

MERN authentication using JWT and HTTP-Only cookie
JavaScript
291
star
62

node-api-proxy-server

Proxy server to hide public API keys with rate limiting, caching
JavaScript
286
star
63

laravel-sanctum-api

REST API with auth using Laravel 8 and Sanctum
PHP
285
star
64

php_rest_myblog

PHP
281
star
65

tailwind-sandbox

Sandbox used with the Tailwind From Scratch course
HTML
280
star
66

react_webpack_starter

React 16 and Webpack 4 starter pack
TypeScript
277
star
67

next-markdown-blog

Simple blog using Next and Markdown
JavaScript
276
star
68

creative-agency-website

Agency website - basic HTML/CSS
HTML
275
star
69

react-crash-2024

React jobs project from YouTube crash course
HTML
271
star
70

react_file_uploader

React and Express file uploader
JavaScript
268
star
71

alexis_speech_assistant

Python speech assist app
Python
267
star
72

deno-rest-api

Simple REST API using Deno and Oak
TypeScript
266
star
73

go_crash_course

Basics of the go language
Go
264
star
74

url_shortener_service

API to shorten urls using Node, Express & MongoDB
JavaScript
250
star
75

breaking-bad-cast

App to show cast info for breaking bad
JavaScript
250
star
76

electron-course-files

Files and apps for Electron course
JavaScript
248
star
77

react_native_shopping_list

React Native app from crash course
JavaScript
244
star
78

simple-electron-react

Simple boilerplate for building Electron apps with React
JavaScript
243
star
79

bookstore

Simple RESTful JSON api using Nodejs, Express and MongoDB
HTML
240
star
80

meanauthapp

Complete MEAN stack app with authentication
JavaScript
240
star
81

angular-crash-todolist

Simple app for Angular crash course
TypeScript
231
star
82

qr-code-generator

Simple Tool to Generate QR Codes
HTML
223
star
83

node_jwt_example

Example of Node JSON Web Tokens
JavaScript
221
star
84

electronshoppinglist

Shopping list desktop app built on electron
JavaScript
219
star
85

go_restapi

Simple RESTful API using Golang
Go
214
star
86

lyricfinder

App that finds song lyrics using React and the Musixmatch API
JavaScript
211
star
87

svg-css-generator-examples

Tiny projects using generated code from different CSS & SVG generators
HTML
204
star
88

ciblog

Simple blog built on Codeigniter
PHP
202
star
89

larticles_api

Laravel 5.5 API using resources
PHP
193
star
90

codegig

Simple job find app for coders
CSS
191
star
91

node_push_notifications

Example using Node.js and service workers to send and show push notifications
JavaScript
186
star
92

bs4starter

Starter pack for Bootstrap 4 Beta
JavaScript
183
star
93

support-desk

Support ticket app built with the MERN stack
JavaScript
178
star
94

mongochat

Simple chat app using Mongo and websockets
HTML
178
star
95

nestjs_rest_api

Rest api built with Nest and MongoDB
TypeScript
173
star
96

next-13-crash-course

JavaScript
173
star
97

microposts_fullstack_vue

Full stack vue and express
JavaScript
172
star
98

flask_sqlalchemy_rest

Products REST API using Flask, SQL Alchemy & Marshmallow
Python
171
star
99

pollster_django_crash

Polling app built with Django (Django Crash Course)
Python
170
star
100

huddle_styled_components

Landing page from styled components crash course
JavaScript
168
star