sort algorithm(1)
+) sorting 알고리즘을 시각화 한 사이트 bubble sort(sinking sort) Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the input list element by element, comparing the current element with the one after it, swapping their values if needed bubbleSort([5, 4, 1, 3, 2]) // [1, 2, 3, 4, 5] 최대값을 찾아 배열을 오른쪽 => 왼쪽 순으로 정렬한다. [5, 4, 1, 3, 2]의 배열을 bubble sort를 ..
problem solving patterns(2)
1. frequency counter pattern 예제 문제1 same([1, 2, 3, 3], [9, 4, 1, 9]) // true same([1, 2, 3, 3], [9, 4, 1]) // false 1. write a function called "same", which accepts 2 arrays. 2. the function should return "ture" if every value in the array has it's corresponding value squared in the second array. 3. the frequency of values must be the same. 문제 풀이한 방법 const squared = [1, 9, 25, 25] getFrequencyOf..