본문 바로가기 메뉴 바로가기

Studying programming

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Studying programming

검색하기 폼
  • Jimin's Programming (194)
    • Algorithms (54)
    • JavaScript (16)
    • Vue.js (3)
    • Node.js (3)
    • React.js (7)
    • React Native (0)
    • Spring Boot (13)
    • JAVA (58)
    • C++ (17)
    • Programming (19)
    • Computer basics (4)
  • 방명록

java (14)
Insertion Sort

Insertion Sort 삽입정렬 Insert an element in the sorted subarray to its left. 두번째 Index를 시작으로 자신보다 앞 쪽 (왼쪽) 의 값과 계속 비교해가면서 자리를 옮겨나가는 알고리즘이다. How the Insertion array works int arr[] = [3,5,1,4,2] partial sorted subarray partial unsorted array [3] [5,1,4,2] [3,5] [1,4,2] [3,5,1] -> [3,1,5] -> [1,3,5] [4,2] [1,3,5,4] -> [1,3,4,5] [2] [1,3,4,5,2] -> [1,3,4,2,5] -> [1,3,2,4,5] -> [1,2,3,4,5] [] Solution ..

Algorithms 2019. 8. 1. 14:08
Sequential Search Algorithm (Linear Search)

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..

Algorithms 2019. 7. 30. 06:02
Arrays.sort in Java

Array.sort() sort the Array in ascending order Example Code import java.util.Arrays; public class Main { public static void main(String[] args) { int arr[] = {2,7,1,9,7}; for (int number : arr) { System.out.print(number); //27197 } // sorting array Arrays.sort(arr); System.out.println("\nSorted numbers are"); for (int number : arr) { System.out.print(number); //12779 } } }

JAVA 2019. 7. 23. 09:34
Collection framework - HashMap

HashMap HashMap is not thread-safe which allows you faster speed than HashTable. HashMap doesn't allow insertion order. *Use LinkedHashMap to preserve the fixed order. key doesn't allow duplicate key, but for value, duplication is allowed. put() - key, value map에 입력 get() - key를 전달해야 그 key의 value가 반환된다. remove() - 해당 key의 key와 value 삭제 Example Code import java.util.*; public class Main { public ..

JAVA 2019. 7. 23. 07:18
File I/O - loading data and creating txt file from CSV file.

students.csv id,name 1,A 2,B 3,C public class StudentInfo { private int id; private String name; public StudentInfo(int id, String name){ this.id = id; this.name = name; } public int studentId(){ return id; } @Override public String toString(){ return "Student Id: " + this.id + ", " + "name: " + this.name + "\n"; } } public class Main { public static void main(String[] args) throws FileNotFoundE..

JAVA 2019. 7. 5. 05:16
Exception handling in Java

예외처리 (Exception handling) 은 프로그램의 논리에 벗어난 에러인 runtime error를 발견하도록 도와준다. - 사용자정의 exception handling 이 아닌 자바에 자체적으로 내장되어있는 에러클래스의 경우 (e.g. ArithmeticException) 사용자가 새롭게 객체를 정의하지 않아도 JVM에 의해 생성된 인스턴스의 참조값이 전달된다. import java.util.Scanner; class Main{ public static void main(String[] args){ System.out.print("Enter two digits: "); Scanner keyboard = new Scanner(System.in); int num1 = keyboard.nextInt..

JAVA 2019. 6. 24. 03:27
이전 1 2 3 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • HackerRank Algorithm
  • ... in Javascript
  • equals()
  • hackerrank javascript
  • code refactoring
  • Collection Framework
  • easy algorithm
  • easy javascript algorithm
  • algorithm
  • javascript
  • rest parameter
  • C++
  • substring()
  • 프로그래머스
  • math.abs
  • compareTo()
  • repeat()
  • spring boot application
  • 프로그래머스 알고리즘문제
  • string class in java
  • 프로그래머스 알고리즘
  • hackerrank solution
  • Javascript Algorithm
  • java
  • HashMap
  • math.max
  • Object type casting
  • 알고리즘
  • hackerrank javascript solution
  • hackerrank
more
«   2025/09   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바