티스토리 뷰

1. ArrayList 와 LinkedList 의 장단점은?

 

ArrayList 장점: 배열기반이라 참조(=검색=searching)가 빠르다. 그리고 무작위 접근도 가능하다.

ArrayList 단점: 저장, 삭제, 추가를 하려면 저장 공간을 복사를 하든 뭘 하든 늘려야 해서 느림

 

LinkedList 장점: 저장공간 늘릴 필요없이 그 다음에 있는 주소공간만 바꿔주면 되어서 저장, 삭제, 추가가 빠름 

LinkedList 단점: 검색이 느림. 왜냐 앞에서든 뒤에서든 순차적 접근을 하기 때문이다.

 

 


2. 로또 프로그램을 작성하시오.(Set 으로)

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.HashSet;
import java.util.Set;
 
public class HashSetLottery {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
 
        while (set.size() != 6) {
            int rNum = (int)(Math.random() * 45 + 1);
            set.add(rNum);
        }
        System.out.print("로또 번호: ");
        for (Integer num : set)
            System.out.print(num + "\t");
        System.out.println();
 
    }
}
cs

 

 

 


3. Set에 대하여 설명하시오.

 

Set이라는 class는 내부적으로 equals() 와 hashCode()를 실행해서 동일함을 판단한다.

 

 

 


4. 아래의 선택자에 대하여 설명하시오. (HTML)

>
+
~
[]

 

 

> : 자손. div 밑에 바로 자식

1
2
3
4
5
6
7
8
9
10
<style>
    #header, #wrap, #footer {
        border: 1px solid #cccccc;
        width: 500px;
    }
    div > h1 {
        font-weight: bold;
        color: yellow;
    }
</style>
cs

 

 

 

+: 바로 옆에거 (동위선택자)

1
2
3
4
5
6
7
8
9
<style>
 
h3+div{
    font-size: 20px;
    font-weight: bold;
    color: blue;
}
 
</style>
cs

 

 

~ : 끝까지 (동위선택자)

1
2
3
4
5
6
7
8
9
10
11
12
13
<style>
 
h3+div{
    font-size: 20px;
    font-weight: bold;
    color: blue;
}
#title~div{
    width: 300px;
    background-color:lavenderblush;
}
 
</style>
cs

 

 

 

 

 

[ ]: (속성선택자)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<style>
    input {
        color: aquamarine;
        font-size: 30px;
        font-weight: bold;
    }  
    input[type=text] {
        color: orange;
        font-size: 50px;
        width: 200px;
    }
    input[type=tel] {
        color:lightpink;
    }
    img[src] {
        border: 5px solid green;
    }
</style>
cs

 

 

 

 


5. 하이 서울 브랜드를 html 로 짜시오.

 

 

모범답안:

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>8일 문제 정답확인</title>
        <style>
            #center,
            #footer,
            #header {
                width: 1000px;
 
                /* margin 중앙정렬 의미 */
                margin: 0, auto;
 
                /* 집 나간 토끼 데려와 */
                overflow: hidden;
 
            }
 
            #center .left_space,
            #footer .left_space,
            #header .left_space {
                width: 150px;
                height: 150px;
                float: left;
                background-color: #f3f3f3;
                border: 1px solid black;
 
            }
 
            #center .center_space,
            #footer .center_space,
            #header .center_space {
                width: 694px;
                height: 150px;
                float: left;
                background-color: #f3f3f3;
                border: 1px solid black;
            }
 
            #center .right_space,
            #footer .right_space,
            #header .right_space {
                width: 150px;
                height: 150px;
                float: left;
                background-color: #f3f3f3;
                border: 1px solid black;
 
            }
 
            #footer .right_space,
            #header .left_space {
                border-radius: 30px 0;
            }
            #footer .left_space,
            #header .right_space {
                border-radius: 0 30px;
            }
 
            #center .left_space {
                border-radius: 0 30px 30px 0;
                height: 300px;
            }
            #center .right_space {
                border-radius: 30px 0 0 30px;
                height: 300px;
            }
 
            #header .center_space {
                border-radius: 0 0 30px 30px;
            }
 
            #center .center_space {
                border-radius: 30px;
                height: 300px;
            }
 
            #footer .center_space {
                border-radius: 30px 30px 0 0;
            }
 
            #center .center_space ul li {
                list-style: none;
                float: left;
                padding: 0 40px;
                font-weight: bold;
                font-size: 20px;
            }
 
            #center .hiseoul {
                clear: both;
                padding: 10px;
 
            }
        </style>
 
    </head>
    <body>
        <!-- id이름 하나, class는 같은 이름 반복가능 -->
 
        <div id="header">
            <div class="left_space"></div>
            <div class="center_space"></div>
            <div class="right_space"></div>
        </div>
 
        <div id="center">
            <div class="left_space"></div>
            <div class="center_space">
                <div>
                    <div>
                        <ul>
                            <li>menu1</li>
                            <li>menu2</li>
                            <li>menu3</li>
                            <li>menu4</li>
                        </ul>
                    </div>
                    <div class="hiseoul">
                        <h1>하이서울브랜드</h1>
                        <p>서울시와 서울산업진흥원(SBA)이 공동으로 지원하는 하이 서울브랜드 사업은 우수한 기술력과 상품력을 보유하고 있으나 고유브랜드 육성에
                            어려움을 겪고 있는 우수기업들이 서울시가 인정한 중소기업 공동브랜드인 하이서울브랜드를 활용하여 제품 경쟁력을 강화할 수 있도록 각종 홍보
                            마케팅을 지원하는 사업입니다.
                        </p>
                    </div>
 
                </div>
            </div>
            <div class="right_space"></div>
        </div>
 
        <div id="footer">
            <div class="left_space"></div>
            <div class="center_space"></div>
            <div class="right_space"></div>
        </div>
 
    </body>
</html>
cs

 

 

 

 

 

 

언제나 그렇듯 모로가도 한양은 간.. 아무튼 도착은 한 나의 코딩 ㅎㅎ ^^;;

 

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>8-4전체레이아웃설정</title>
        <style>
 
            #wrap { 
                width: 1000px;
                height: 1000px;
                overflow: hidden;
 
            } 
 
            #header {
                overflow: hidden;
            }
            .left {
                background-color: thistle;
                width: 100px;
                height: 100px;
                float: left;
                border-radius: 20px 0 20px 0;
                border: 1px solid #808080;
 
            }
            .center {
                background-color: thistle;
                width: 500px;
                height: 100px;
                float: left;
                border-radius: 0 0 20px 20px;
                border: 1px solid #808080;
 
            }
            .right {
                background-color: thistle;
                width: 100px;
                height: 100px;
                float: left;
                border-radius: 0 20px 0 20px;
                border: 1px solid #808080;
 
            }
 
            .left2 {
                background-color: thistle;
                width: 100px;
                height: 300px;
                float: left;
                border-radius: 0 20px 20px 0;
                border: 1px solid #808080;
 
            }
 
            #contents {
                overflow: hidden;
            }
            .center2 {
                background-color: thistle;
                width: 480px;
                height: 280px;
                padding: 10px;
                font-size: 15px;
                float: left;
                border-radius: 20px 20px 20px 20px;
                border: 1px solid #808080;
 
            }
            .right2 {
                background-color: thistle;
                width: 100px;
                height: 300px;
                float: left;
                border-radius: 20px 0 0 20px;
                border: 1px solid #808080;
 
            }
            ul li {
                list-style: none;
                font-weight: bold;
                text-align: center;
                float: left;
                margin-left: 30px;
 
            }
            #footer {
                width: 800px;
                height: 150px;
                overflow: hidden;
                text-align: center;
                border-radius: 20px 20px 20px 20px;
            }
 
            .left3 {
                background-color: thistle;
                width: 100px;
                height: 100px;
                float: left;
                border-radius: 0 20px 0 20px;
                border: 1px solid #808080;
 
            }
            .center3 {
                background-color: thistle;
                width: 500px;
                height: 100px;
                float: left;
                border-radius: 20px 20px 0 0;
                border: 1px solid #808080;
 
            }
            .right3 {
                background-color: thistle;
                width: 100px;
                height: 100px;
                float: left;
                border-radius: 20px 0 20px 0;
                border: 1px solid #808080;
            }
        </style>
 
    </head>
    <body>
<div id="wrap">
        <div id="header">
            <div class="left"></div>
            <div class="center"></div>
            <div class="right"></div>
 
        </div>
 
        <div id="contents">
            <div class="left2"></div>
 
            <div class="center2">
 
                <ul>
                    <li>menu1</li>
                    <li>menu2</li>
                    <li>menu3</li>
                    <li>menu4</li>
                </ul>
                <br/>
 
                <h1>하이서울브랜드</h1>
                <p>서울시와 서울산업진흥원(SBA)이 공동으로 지원하는 하이 서울브랜드 사업은 우수한 기술력과 상품력을 보유하고 있으나 고유브랜드 육성에
                    어려움을 겪고 있는 우수기업들이 서울시가 인정한 중소기업 공동브랜드인 하이서울브랜드를 활용하여 제품 경쟁력을 강화할 수 있도록 각종 홍보
                    마케팅을 지원하는 사업입니다.
                </p>
            </div>
            <div class="right2"></div>
 
        </div>
        <div id="footer">
            <div class="left3"></div>
            <div class="center3"></div>
            <div class="right3"></div>
 
        </div>
    </div>
 
    </body>
</html>
cs

 

 

 

 


6.금요일 다하지 못한 문제가 있으면 문제를 푸시오.

 


7.개별진척도 못한거 다시 한번 풀어 주세요.

 

 

'면접준비 > KOSMO 허쌤 숙제' 카테고리의 다른 글

학습정리-11-10  (0) 2021.11.10
학습정리-11-09  (0) 2021.11.09
학습정리-11-05  (0) 2021.11.06
학습정리-11-04  (0) 2021.11.04
학습정리-11-03  (0) 2021.11.03
댓글