Eunhan's library

Eunhan's web site

what happen if + or - with Char in JAVA

Result code result char type + int type return unicode char type - int type error int type + char type return unicode int type - char type error char type + char type return unicode char type - char type return unicode String is not Primitive Data Type. This is object example of use For lexicographical order for (int i = 0; i < order.

what is difference between Error and Exception in Java

What is Error Programs run something that is not what programmers wanted or shutdown unexpectedly. Any causes of that action are Error. Kinds of Errors compile-time error compile failed. usually, wrong lanuage keyword used. python does not understand “System.out.println” This code is for JAVA. runtime error crash during the programs run. put values in int arr[5] that array size is 3 logical error programmer created wrong process. you wanted to put blue in variable x.

inclusive and exclusive

Inclusive - Including the last number Exclusive - Excluding the last number In Computer Science, inclusive/exclusive apply to a number range Example inclusive If a function will compute $2^i$ where $i = 1, 2, …, n$. $i$ can have values from 1 up to and including the value n. We says, n is Included in Inclusive 1 through 10 (inclusive) = [1, 10] 1 2 3 4 5 6 7 8 9 10 exclusive If a function will compute $2^i$ where i = 1, 2, .

[JAVA code]Alphabetical Order

Alphabetical Order According to ASCII rules [numbers][capital letters][lowercase letters] 0 ~ 9, A ~ Z, a ~ z Time complexity : $O(n\ log\ n)$ Space complexity : $O(1)$ For List Collections.sort(List<String>_values); For Array Arrays.sort(String[]array); Time complexity : $O(n^2)$ Space complexity : $O(1)$ public static String[] LexicalOrder(String[] words) { int n = words.length; for (int i = 0; i < n - 1; ++i) { for (int j = i + 1; j < n; ++j) { if (words[i].

Dynamic Programming

Definition algorithmic problem solving technique that split into many simple subproblems and reduce steps of subproblems. In other wards, separates into subproblems and get solution by addition of all subproblems. Example if you calculate $2^1+2^2+2^3+2^4+2^5$ and display each numbers, $2^1=2=2$ $2^2=22=2^12$ $2^3=222=2^2*2$ $2^4=2222=2^32$ $2^5=22222=2^4*2$ since you need to calculate each of numbers ($2^1,2^2,2^3,2^4,2^5$), you can skip some of parts that you already calculated. When you calculate the $2^5$, you done have to calculate $2^4$ if that number $2^4$ is already calculated.