일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- Programmers
- 알pdf #파일탐색기미리보기안될때
- 7기
- TDD
- typeScript
- NotionAI
- 달리기반
- 실전프로젝트
- Ai
- TS
- 코린이
- Expo
- 웹개발종합반
- 사전준비
- 리액트
- 맥린이
- 필수강의
- 팀워크최고
- 프로그래머스
- 프론트엔드
- ChatGPT
- 항해99
- ReactNative
- REACT
- 멍친구
- 스파르타코딩클럽
- rn
- 알고리즘기초주차
- D반8조
- 챗GPT
- Today
- Total
목록JavaScript/Algorithm (27)
FrontEnd :-)

Udemy - 【한글자막】 JavaScript 알고리즘 & 자료구조 마스터클래스 SLIDING WINDOW 기준점 간 이동 배열 패턴 This pattern involves creating a window which can either be an array or number from one position to another. Depending on a certain condition, the window either increases or closes (and a new window is created). Very useful for keeping track of a subset of data in an array/string etc. 배열/ 문자열 등에서 데이터의 하위 집합을 추적하는 데 매우 유용합..

Udemy - 【한글자막】 JavaScript 알고리즘 & 자료구조 마스터클래스 Divide and Conquer 분할과 정복 패턴 This pattern involves dividing a data set into smaller chunks and then repeating a process with a subset of data. This pattern can tremendously decrease time complexity #1. Divide and Conquer Given a sorted array of integers, write a function called search, that accepts a value and returns the index where the value passed ..

Udemy - 【한글자막】 JavaScript 알고리즘 & 자료구조 마스터클래스 #1. Frequency Counter - Multiple Pointers Write a function called sumZero which accepts a sorted array of integers. The function should find the first pair where the sum is 0. Return an array that includes both values that sum to zero or undefined if a pair does not exist //Time Complexity - O(N^2) //Space Complexity - O(1) function sumZero(arr){ for(..

Udemy - 【한글자막】 JavaScript 알고리즘 & 자료구조 마스터클래스 #1. Frequency Counter - sameFrequency Write a function called same, which accepts two arrays. The function should return true if every value in the array has it's corresponding value squared in the second array. The frequency of values must be the same. //시간복잡도: O(n^2) //indexOf 는 전체 배열을 반복하거나 중첩된 루프인 전체 배열을 잠재적으로 반복하는 것. function same(arr1, arr2) { i..
Udemy - 【한글자막】 JavaScript 알고리즘 & 자료구조 마스터클래스 :: 섹션 4 문제 해결 접근법 HOW DO YOU IMPROVE? Devise a plan for solving problems Master common problem solving patterns PROBLEM SOLVING Understand the Problem Explore Concrete Examples Break It Down Solve/Simplify Look Back and Refactor 1. UNDERSTAND THE PROBLEM 문제의 이해 Can I restate the problem in my own words? What are the inputs that go into the problem? Wh..
Udemy - 【한글자막】 JavaScript 알고리즘 & 자료구조 마스터클래스 :: 섹션 3 배열과 오브젝트의 성능 평가 객체의 빅오 Big O of Objects Insertion - O(1) Removal - O(1) Searching - O(N) Access - O(1) When you don't need any ordering, objects are an excellent choice! Big O of Object Methods Object.keys - O(N) Object.values - O(N) Object.entries - O(N) hasOwnProperty - O(1) Quiz 질문 1: 오브젝트에 키와 값을 추가하기 위한 빅오는 무엇일까요? 답: O(1) 질문 2: 오브젝트의 키에 접근..

Udemy - 【한글자막】 JavaScript 알고리즘 & 자료구조 마스터클래스 :: 섹션 2 빅오 표기법(Big O Notation) 빅오(Big O) - 여러가지 코드를 일반적을 서로 비교하고 성능을 평가하는 방법입니다. Timing function performance.now(); 활용해서 함수 작동 시간 확인하기 function addUpTo(n) { let total = 0; for (let i = 1; i Time Elapsed: 0.0175 seconds function addUpTo(n) { return n*(n+1)/2; } => for문보다 빠름. n 값과는 상관없이 연산 3번(곱하기, 더하기, 나누기) 일어남. => for문에서 total += i 를 보면 n 번의 더함(additio..

최빈값 구하기 🙋 (문제) 최빈값은 주어진 값 중에서 가장 자주 나오는 값을 의미합니다. 정수 배열 array가 매개변수로 주어질 때, 최빈값을 return 하도록 solution 함수를 완성해보세요. 최빈값이 여러 개면 -1을 return 합니다. 제한사항 0 b - a) return (max[0] === max[1]) ? -1 : +Object.keys(obj).find(key => obj[key] === max[0]); } ✅ (풀이 과정) 1번째 실패 1. array 에 값이 하나일 때는, 그 값을 return한다. 2. 객체를 만든다. key에는 값을, value에는 중복 횟수를 저장한다. 3. 객체 value값을 내림차순 정렬해서 첫 번째 값과 두 번째 값이 같으면 -1 반환하고, 아니면 첫 ..