Mac OS Java 8.0 MySQL 5.7.27 connector 8.0.17 Install MySQL Option 1. Visit MySQL website to download https://dev.mysql.com/downloads/connector/j Option 2. Use Homebrew which is a free and open-source software package management system that simplifies the installation of software on Apple's macOS. Decompress the file. We will use file mysql-connector-java-8.0.17.jar Connecting to JDBC IntelliJ -..
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..
Selection Sort 선택정렬 Selection sort searches for the smallest element among the unsorted elements sort them in ascending order and places them in order from the first index of the array. Solution in Java public class Main { public static void main(String[] args) { int arr[] = {37, 15, 8, 22, 10}; //required {8, 10, 15, 22, 37} in ascending order. selectionSort(arr); showArr(arr); } private static..
Primitive types swap method will never work because Java is strictly Pass-By-Value. If you want to swap two arguments, use array or object to send reference as a value. Example I primitive types are never changed class Main { //primitive type doesn't swap public static void swap(int i, int j) { int temp = i; i = j; j = temp; } public static void main(String[] args) { int i = 10; int j = 20; swap..
Bubble Sort 버블정렬 맨 앞의 index부터 바로 옆의 index와 비교를 해서 큰 수가 오른쪽으로 자리하면서 더이상 비교할 값이 없을 때까지 정렬을 해나가는 알고리즘. 3 2 5 1 4 1st Pass - The largest number is placed at the last when each pass is complete. 한번의 실행마다 가장 큰 수가 가장 마지막 index 에 자리하게 된다. 2 3 1 4 5 2nd Pass 2 1 3 4 5 3rd Pass 1 2 3 4 5 Example Code in Java public class Main { public static void main(String[] args) { int arr[] = {3,2,5,1,4}; printArray(a..
Recursion in Java 재귀호출 In programming, It's common to call a method from another method. Recursion allows calling the method itself. A factorial example is a popular way to understand the basic principle of recursion. 재귀함수는 재귀를 종료시킬 조건에 부합할 때까지 자기 자신의 메서드를 계속 호출하기 때문에 종료조건에 다다르고 나서야 값을 리턴하기 시작한다. factorial 5! = 5 x 4 x 3 x 2 x 1 5! = 5 x 4! 4! = 4 x 3 x 2 x 1 4! = 4 x 3! factorial using loop pub..
- Total
- Today
- Yesterday
- 프로그래머스 알고리즘
- java
- easy javascript algorithm
- repeat()
- Javascript Algorithm
- math.abs
- hackerrank solution
- string class in java
- equals()
- 프로그래머스
- javascript
- 프로그래머스 알고리즘문제
- substring()
- hackerrank
- HackerRank Algorithm
- C++
- hackerrank javascript
- compareTo()
- ... in Javascript
- algorithm
- code refactoring
- 알고리즘
- math.max
- HashMap
- easy algorithm
- Object type casting
- rest parameter
- hackerrank javascript solution
- spring boot application
- Collection Framework
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |