Skip to content

SunTheCoder/Study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Study

  • Resizing Arrays is expensive

Linked List

Linked List

Middle of the Linked List

Linked List Cycle

Delete Middle Node of a Linked List

Remove Duplicates from Sorted List

Sieve of Eratosthenes

Priority: High

Sieve of Eratosthenes

  • Time Complexity: O(n log log n)
  • Space Complexity: O(n)
  • Used to find all prime numbers up to a given limit
function sieveOfEratosthenes(n) {
  const isPrime = new Array(n + 1).fill(true);
  isPrime[0] = isPrime[1] = false;

  for (let i = 2; i * i <= n; i++) {
    if (isPrime[i]) {
      for (let j = i * i; j <= n; j += i) {
        isPrime[j] = false;
      }
    }
  } 

  const primes = [];
  for (let i = 2; i <= n; i++) {
    if (isPrime[i]) {
      primes.push(i);
    }
  } 

  return primes;
}   

Tuple Same Product

Priority: High

Tuple Same Product

Sliding Window

Priority: High

Find Index of First Occurence in a String

Distint Numbers in Each Subarray

Priority: High

Distinct Numbers in Each Subarray

  • Time Complexity: O(n)
  • Space Complexity: O(n)
  • Used to find the number of distinct numbers in each subarray

Two Pointers

Two Pointers

Prefix Sum

Hash Table

Priority: High

Sentence Similarity

Next Greater Element

Stacks

Priority: High

Stacks

Simplify Path

IsValid

Reverse Prefix of Word

Next Greater Element

Moving Average from Data Stream

Queue

Queue

About

Study Repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors