Question Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with 6 places after the decimal. 주어진 Array안에서 negative value, positive value 그리고 0 의 수가 array크기에 얼마나 비례하는지 소수점 6자리까지 프린트하는 문제. Example output 0.400000 0.400000 0.200000 Solution let arr = [1, 1, 0, -1, -1]; function diagonalDiffer..

Question Given a square matrix, calculate the absolute difference between the sums of its diagonals. 2d array 의 서로 다른 두 개의 대각선 값의 Absolute difference 즉, 절대값을 결과로 보여주는 문제. For example, 1 2 3 4 5 6 9 8 9 (1 + 5 + 9) - (3 + 5+ 9) |15 - 17| the absolute difference is 2. Tip. 0 1 2 0 o x o 1 x o x 2 o x o 필요한 부분이 나오는 배열의 형태를 먼저 적어주고 그 형태가 나올 수 있는 loop의 형태를 고민해 본다. 2d Array는 loop를 적용시키면 Column(세로) 이 순..
Sequential Search Algorithm (Linear Search) 순차탐색 Less used than binary search and Hash Table. Big-O notation for Sequential Search is O(n) which is relatively slower than others. public class Main { public static void main(String[] args) { int arr[] = {7, 4, 3, 1, 5}; int x = 3; int answer = linearSearch(arr, x); if(answer == -1){ System.out.println("No element matched"); }else{ System.out.print..
Algorithm & Data structure What are Algorithms and Data structures? The data structure is those different ways of storing data on your program. e.g. Array, List, Stack, Queue, Tree, Hash etc, The algorithm is operations on different data structures + sets of instructions for executing them. e.g. Sort, Search, Max, Min etc, Let's see the image to get a concrete example. We can see alphabet A to E..
- Total
- Today
- Yesterday
- code refactoring
- 프로그래머스 알고리즘문제
- 프로그래머스 알고리즘
- easy javascript algorithm
- hackerrank javascript
- hackerrank
- hackerrank javascript solution
- C++
- ... in Javascript
- rest parameter
- Object type casting
- repeat()
- spring boot application
- javascript
- algorithm
- Collection Framework
- Javascript Algorithm
- java
- substring()
- equals()
- HashMap
- 알고리즘
- HackerRank Algorithm
- easy algorithm
- hackerrank solution
- math.abs
- math.max
- 프로그래머스
- string class in java
- compareTo()
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |