10๊ฑด์ ํญ๋ชฉ
1๋ฒ ๋ฌธ์ : ์๋ ์ค๋ช ์ ๋ง๋ RAID ๋จ๊ณ๋ฅผ ์ซ์๋ก ์์ฑํ์์ค. Striping(์คํธ๋ผ์ดํ) ๊ตฌํ ๋ฐฉ์ I/O ๋ก๋์ ๋ถ์ฐ์ผ๋ก ๋งค์ฐ ๋น ๋ฅธ ์๋ ๋ฐ์ดํฐ๋ฅผ ๋ธ๋ญ์ผ๋ก ๋ถํ ์ ์ฅํ๋ฉฐ, ๊ฐ ๋ธ๋ญ์ ๋ค๋ฅธ ๋์คํฌ๋ก ๋๋์ด ์ ์ฅ ๋ต: 0 2๋ฒ ๋ฌธ์ : ๋ค์ ์ค๋ช ์ ํ์ธํ์ฌ ํด๋นํ๋ ํญ๋ชฉ์ ๋ณด๊ธฐ์์ ์ฐพ์ ์ ์ผ์์ค.
1๋ฒ ๋ฌธ์ : ๋ค์์ ๊ด๊ณ ๋ฐ์ดํฐ ๋ชจ๋ธ์ ๋ํ ์ค๋ช ์ด๋ค. ๊ดํธ์์ ๋ค์ด๊ฐ๋ ์ฉ์ด๋ฅผ ์์ฑํ์์ค. ( )์ /๋ ๊ด๊ณ ๋ฐ์ดํฐ์ ์ฐ์ฐ์ ํํํ๋ ๋ฐฉ๋ฒ์ผ๋ก, ์ํ๋ ์ ๋ณด๋ฅผ ์ ์ํ ๋๋ ๊ณ์ฐ ์์์ ์ฌ์ฉํ๋ค. ์ํ์ predicate calculus์ ๊ธฐ๋ฐ์ ๋๊ณ ์์ผ๋ฉฐ, ๊ด๊ณ ๋ฐ์ดํฐ ๋ชจ๋ธ์ ์ ์์์ธ codd๊ฐ ์ํ์ ๊ฐ๊น์ด ๊ธฐ๋ฐ์ ๋๊ณ ํน๋ณํ ๊ด๊ณ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์ํด ์ ์ํ์ฌ ํ์ํ์๋ค.
1๋ฒ ๋ฌธ์ : ์๋๋ C์ธ์ด์ 2์ฐจ์ ๋ฐฐ์ด ํํ์ด๋ค. field์ ๊ฒฝ์ฐ 2์ฐจ์ ๋ฐฐ์ด ํํ๋ ์์์ฒ๋ผ ์ถ๋ ฅ๋๋ฏ๋ก, ์ด๋ฅผ ์ฐธ๊ณ ํ์ฌ mines์ 2์ฐจ์ ๋ฐฐ์ด ํํ๋ฅผ ์์ฑํ์์ค. void main{ field {{0,1,0,1},{0,0,0,1},{1,1,1,0},{0,1,1,1}}; mines {{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}; int w = 4, h = 4; for(y=0; y<h; y++) { for(x=0; x<w; x++) { if(field[y][x] == 0) continue; for(i=y-1; i<=y+1; i++) { for(j=x-1; j<=x+1; j++) { if(calculate(w,h,j,i) == 1) { mines[i][j] += 1; } } } } } for(y=0; y<h; y++){ for(x=0; x<w; x++) { printf("%d", mines[y][x]); printf("\n"); } } } int calculate(w,h,j,i) { if (i >= 0 && i < h && j >= 0 && j < w) return 1; return 0; } ๋ต: 1, 1, 3, 2 3, 4, 5, 3 3, 5, 6, 4 3, 5, 5, 3 2๋ฒ ๋ฌธ์ : ์๋ ์์๋ฅผ ๋ณด๊ณ ๊ด๊ณ ๋์์ ๋ํ ๊ธฐํธ๋ฅผ ์์ฑํ์์ค.
1๋ฒ ๋ฌธ์ : ๋ค์ Java ์ฝ๋์ ์ถ๋ ฅ๊ฐ์ ์์ฑํ์์ค. class Static{ public int a = 20; static int b = 0; } public class Main{ public static void main(String[] args) { int a; a = 10; Static.b = a; Static st = new Static(); System.out.println(Static.b++); System.out.println(st.b); System.out.println(a); System.out.print(st.a); } } ๋ต: 10 11 10 20 2๋ฒ ๋ฌธ์ : ๋ค์ C์ธ์ด ์ฝ๋์ ์ถ๋ ฅ๊ฐ์ ์์ฑํ์์ค.
1๋ฒ ๋ฌธ์ : ๋ค์์ C์ธ์ด ์ฝ๋์ ๋ฌธ์ ์ด๋ค. ๋ณด๊ธฐ์ ์กฐ๊ฑด์ ๋ง๋๋ก ๊ดํธ์์ ์๋ง์ ์ฝ๋๋ฅผ ์์ฑํ์์ค. ๋ณด๊ธฐ ์ ๋ ฅ๊ฐ์ด 54321์ผ ๊ฒฝ์ฐ ์ถ๋ ฅ๊ฐ์ด 43215๋ก ์ถ๋ ฅ๋์ด์ผ ํ๋ค. int main(void) { int n[^5]; int i; for (i = 0; i < 5; i++) { printf("์ซ์๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์ : "); scanf("%d", &n[i]); } for (i = 0; i < 5; i++) { printf("%d", ( ) ); } return 0; } ๋ต: n$(i+1) % 5$ 2๋ฒ ๋ฌธ์ : ๋ค์์ JAVA ์ฝ๋ ๋ฌธ์ ์ด๋ค.
1๋ฒ ๋ฌธ์ : ๋ค์์ Java ์ฝ๋์ด๋ค. ์ฌ๋ฐ๋ฅธ ์ถ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ์์ฑํ์์ค. public class main{ public static void main(String[] args) { A b = new B(); b.paint(); b.draw(); } } class A { public void paint() { System.out.print("A"); draw(); } public void draw() { System.out.print("B"); draw(); } } class B extends A { public void paint() { super.draw(); System.out.print("C"); this.draw(); } public void draw() { System.out.print("D"); } } ๋ต: BDCDD 2๋ฒ ๋ฌธ์ : ๋ค์ ์ค๋ช ํ๋ ์ฉ์ด๋ฅผ ๋ณด๊ธฐ์ ๋ง๊ฒ ๊ณจ๋ผ ๊ธฐํธ๋ฅผ ์์ฑํ์์ค.
1๋ฒ ๋ฌธ์ : ๋ค์ Java ์ฝ๋์์ ์๋ง๋ ์ถ๋ ฅ ๊ฐ์ ์์ฑํ์์ค. class Connection { private static Connection _inst = null; private int count = 0; static public Connection get() { if(_inst == null) { _inst = new Connection(); return _inst; } return _inst; } public void count() { count++; } public int getCount() { return count; } } public class main { public static void main(String[] args) { Connection conn1 = Connection.get(); conn1.count(); Connection conn2 = Connection.get(); conn2.count(); Connection conn3 = Connection.get(); conn3.count(); conn1.count(); System.out.print(conn1.getCount()); } } ๋ต: 4 2๋ฒ ๋ฌธ์ : ๋ค์ C์ธ์ด ์ฝ๋์์ ์๋ง๋ ์ถ๋ ฅ ๊ฐ์ ์์ฑํ์์ค.
1๋ฒ ๋ฌธ์ : ๋ค์์ Java ์ฝ๋์ ๋ํ ๋ฌธ์ ์ด๋ค. ์๋ ์ฝ๋๋ฅผ ํ์ธํ์ฌ ์๋ง๋ ์ถ๋ ฅ๊ฐ์ ์์ฑํ์์ค. class Main { public static void main(String[] args) { int[] a = new int[]{1, 2, 3, 4}; int[] b = new int[]{1, 2, 3, 4}; int[] c = new int[]{1, 2, 3}; check(a, b); check(a, c); check(b, c); } public static void check(int[] a, int[] b) { if (a==b) { System.out.print("O"); }else{ System.out.print("N"); } } } ๋ต: NNN 2๋ฒ ๋ฌธ์ : ๋ค์ ๋ฌธ์ ์์ ์ค๋ช ํ๋ ์ฉ์ด๋ฅผ ์์ฑํ์์ค.
1๋ฒ ๋ฌธ์ : ๋ค์์ Java ์ฝ๋์ ๋ํ ๋ฌธ์ ์ด๋ค. ์๋ ์ฝ๋๋ฅผ ํ์ธํ์ฌ ์๋ง๋ ์ถ๋ ฅ๊ฐ์ ์์ฑํ์์ค. public class Main{ static String[] s = new String[^3]; static void func(String[]s, int size){ for(int i=1; i<size; i++){ if(s[i-1].equals(s[i])){ System.out.print("O"); }else{ System.out.print("N"); } } for (String m : s){ System.out.print(m); } } public static void main(String[] args){ s[^0] = "A"; s[^1] = "A"; s[^2] = new String("A"); func(s, 3); } } ๋ต: OOAAA 2๋ฒ ๋ฌธ์ : ๋ค์์ ํ์ด์ฌ์ ๋ํ ๋ฌธ์ ์ด๋ค.
1๋ฒ ๋ฌธ์ : ๋ค์์ ๋คํธ์ํฌ ๋ณด์์ ๊ด๋ จ๋ ๋ฌธ์ ์ด๋ค. ๊ดํธ์์ ์๋ง๋ ์ฉ์ด๋ฅผ ์์ฑํ์์ค. ( )์/๋ โ์ธ์ ์ ๊ฐ๋ก์ฑ๋ค.โ ๋ผ๋ ์๋ฏธ๋ก ๋ค๋ฅธ ์ฌ๋์ ์ธ์ ์ํ๋ฅผ ํ์น๊ฑฐ๋ ๋์ฉํ์ฌ ์ก์ธ์คํ๋ ํดํน ๊ธฐ๋ฒ์ด๋ค. TCP ( )์/๋ TCP์ 3-way ํธ๋์ ฐ์ดํฌ๊ฐ ์๋ฃ๋ ํ์ ๊ณต๊ฒฉ์๊ฐ ์ํ์ค ๋ฒํธ ๋ฑ์ ์กฐ์ํ์ฌ ์ ์์ ์ธ ์ธ์ ์ ๊ฐ๋ก์ฑ๊ณ ์ธ์ฆ ์์ด ํต์ ์ ํ์ทจํ๋ ๊ณต๊ฒฉ ๊ณต๊ฒฉ์ด๋ค.