Skip to content

Instantly share code, notes, and snippets.

View sunil-bagde's full-sized avatar

Sunil Bagde sunil-bagde

View GitHub Profile
@sunil-bagde
sunil-bagde / revision-grokking-algoithms.md
Created November 7, 2024 14:46
revision-grokking-algoithms

Chapter 1

Binary search

divide array into sub parts until target is found

function binarySearch(nums, target) {

let low = 0

k-nearest neighbors 10

  • to build a classification system using the k-nearest neighbors algorithm.
  • regression: predicting a number,like the value of a stock tomorrow, or how much a user will enjoy a movie.
  • the use cases and limitations of k-nearest neighbors.

k-nearest neighbors (KNN)

greedy algorithms | 8

In this chapter

  • Learn how to tackle the impossible NP-complete problem
  • Learn to indetify such problem
  • To find an approximate solution to an NP-complete problem quickly
  • You learn about the greedy strategy, a very simple

hash tables | 5

In this chapter

  • hash table is most basics data structure, its has many use cases
  • implementation, collisions, and hash functions

suppose you work at grocery store when customer buy a product you have to look up price in a book. if book is unalphabetized it can take long time

@sunil-bagde
sunil-bagde / Grokking-Algorithms-Chap-3-4.md
Last active November 3, 2024 11:49
Grokking-Algorithms

Recursion | 3

In this chapter

  • Recursion is coding technique used in many algorithms.

  • Learn how to break problem down into a base case and a recursive case. divide-and-conquer strategy.

@sunil-bagde
sunil-bagde / Grokking-Algorithms-Chapter-1-2.md
Last active November 3, 2024 11:44
Grokking-Algorithms

Grokking Algorithms

Introduction to algorithms | 1

In this chapter

  • Binary search
  • Big O notation run time of algorithm
@sunil-bagde
sunil-bagde / notes-js.md
Last active October 18, 2024 20:41
Js notes

JS

What is compilations vs polyfilling

Babel to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.

Other compiler

TypeScript

@sunil-bagde
sunil-bagde / .aliases
Last active April 5, 2024 14:01
Aliases
# aliases
alias c="clear"
export NODE_ENV=local
alias dnpm='docker-compose up -d scripts && docker-compose exec scripts npm
run ts:build && docker-compose exec scripts npm '
#export NODE_PATH=$(npm root -g)
# Git
colors.sh
# This is the custom theme template for gitprompt.sh
# These are the defaults from the "Default" theme
# You just need to override what you want to have changed
function prompt_callback {
gp_set_window_title ${PWD}
}
override_git_prompt_colors() {
GIT_PROMPT_THEME_NAME="Custom"
# Time12a="\$(date +%H:%M)"
@sunil-bagde
sunil-bagde / p2
Created March 13, 2024 10:51 — forked from sunil-bagde-1/p2
{"name":"p2","settings":"{\"settings\":\"{\\n /**\\n * Better Defaults\\n **/\\n \\\"editor.copyWithSyntaxHighlighting\\\": false,\\n \\\"diffEditor.ignoreTrimWhitespace\\\": false,\\n \\\"editor.emptySelectionClipboard\\\": false,\\n \\\"workbench.editor.enablePreview\\\": false,\\n \\\"window.newWindowDimensions\\\": \\\"inherit\\\",\\n \\\"editor.multiCursorModifier\\\": \\\"ctrlCmd\\\",\\n \\\"files.trimTrailingWhitespace\\\": true,\\n \\\"diffEditor.renderSideBySide\\\": false,\\n \\\"editor.snippetSuggestions\\\": \\\"none\\\",\\n \\\"editor.detectIndentation\\\": false,\\n \\\"files.insertFinalNewline\\\": true,\\n \\\"files.trimFinalNewlines\\\": true,\\n\\n /**\\n * Hide Everything\\n */\\n //\\\"workbench.activityBar.location\\\": \\\"hidden\\\",\\n \\\"workbench.sideBar.location\\\": \\\"right\\\", //here\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"editor.lineNumbers\\\": \\\"off\\\",\\n \\\"editor.guides.indentation\\\": false,\\n\\n /**\\n * Silence The Noise\\n