Skip to content

Commit 4154d49

Browse files
authored
Merge pull request #49 from kanghanju/develop
chore: change algorithm image path
2 parents 8f995c7 + 9a73868 commit 4154d49

File tree

10 files changed

+117
-103
lines changed

10 files changed

+117
-103
lines changed

src/main/java/com/example/doumiproject/controller/UserController.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.example.doumiproject.dto.CommentDto;
44
import com.example.doumiproject.dto.PostDto;
5-
import com.example.doumiproject.entity.Comment;
65
import com.example.doumiproject.entity.User;
76
import com.example.doumiproject.exception.user.NotValidateUserException;
87
import com.example.doumiproject.service.CodingTestService;
@@ -13,11 +12,8 @@
1312
import com.example.doumiproject.util.PaginationUtil;
1413
import com.example.doumiproject.validate.UserValidator;
1514
import io.swagger.v3.oas.annotations.Operation;
16-
import io.swagger.v3.oas.annotations.Parameter;
17-
import io.swagger.v3.oas.annotations.Parameters;
1815
import io.swagger.v3.oas.annotations.media.Content;
1916
import io.swagger.v3.oas.annotations.media.ExampleObject;
20-
import io.swagger.v3.oas.annotations.media.Schema;
2117
import io.swagger.v3.oas.annotations.responses.ApiResponse;
2218
import io.swagger.v3.oas.annotations.responses.ApiResponses;
2319
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -233,6 +229,7 @@ public ResponseEntity<Void> withdraw(@PathVariable Long id, HttpSession session)
233229
}
234230

235231
userService.deleteUser(userId);
232+
session.invalidate();
236233

237234
return ResponseEntity.ok().build();
238235
}

src/main/resources/templates/algorithm/dfsAndBfs.html

Lines changed: 65 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
11
<!DOCTYPE html>
22
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
33
<head>
4-
<meta charset="UTF-8">
5-
<title>Doumi</title>
6-
<link href="../../static/css/codingtest/timeComplexity.css"
7-
th:href="@{/css/codingtest/timeComplexity.css}"
8-
rel="stylesheet" type="text/css"/>
9-
<link rel="stylesheet"
10-
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
4+
<meta charset="UTF-8">
5+
<title>Doumi</title>
6+
<link href="../../static/css/fragments/footer.css" th:href="@{/css/fragments/footer.css}"
7+
rel="stylesheet"
8+
type="text/css"/>
9+
<link href="../../static/css/board.css"
10+
th:href="@{/css/board.css}"
11+
rel="stylesheet" type="text/css"/>
12+
<link href="../../static/css/fragments/header.css" th:href="@{/css/fragments/header.css}"
13+
rel="stylesheet"
14+
type="text/css"/>
15+
<link href="../../static/css/algorithm/header.css" th:href="@{/css/algorithm/header.css}"
16+
rel="stylesheet" type="text/css"/>
17+
18+
19+
<link rel="stylesheet"
20+
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
1121
</head>
22+
<div th:replace="~{fragments/header.html::header}"></div>
1223
<body>
13-
<header></header>
1424
<main class="cont-main">
15-
<section class="content-header">
16-
<button class="back-button"><a href="/doumiAlgorithm">< 목록으로</a></button>
17-
<h1 class="title">DFS와 BFS(DFS & BFS)</h1>
18-
<div class="content-info">
19-
<a href="" class="board-writer-name">도우미</a>
20-
<p class="content-createdAt">24.03.20 21:30 작성</p>
21-
</div>
22-
</section>
23-
24-
<section class="content-main">
25-
<h2>DFS (Dept-First Search)</h2>
26-
<br>
27-
<p>깊이 우선 탐색이라고 부르며, 그래프에서 깊은 부분을 우선적으로 탐색하는 알고리즘이다.</p>
28-
<p>이것은 스택이나 재귀 호출을 이용하여 구현할 수 있다.</p>
29-
<p>
30-
<img src="/images/algorithm/dfs.gif" alt="dfs.gif"></p>
31-
<p>재귀함수를 사용하여 구현할 때는 종료 조건을 명확히 해줘야 한다. 그렇지 않으면 무한 루프에 빠지게 된다.</p>
32-
<h3>재귀를 활용한 DFS</h3>
33-
<pre>
25+
<section class="content-header">
26+
<button class="back-button"><a href="/doumiAlgorithm">< 목록으로</a></button>
27+
<h1 class="title">DFS와 BFS(DFS & BFS)</h1>
28+
<div class="content-info">
29+
<a href="" class="board-writer-name">도우미</a>
30+
<p class="content-createdAt">24.03.20 21:30 작성</p>
31+
</div>
32+
</section>
33+
34+
<section class="content-main">
35+
<h2>DFS (Dept-First Search)</h2>
36+
<br>
37+
<p>깊이 우선 탐색이라고 부르며, 그래프에서 깊은 부분을 우선적으로 탐색하는 알고리즘이다.</p>
38+
<p>이것은 스택이나 재귀 호출을 이용하여 구현할 수 있다.</p>
39+
<p>
40+
<img src="/images/algorithm/dfs.gif" alt="dfs.gif"></p>
41+
<p>재귀함수를 사용하여 구현할 때는 종료 조건을 명확히 해줘야 한다. 그렇지 않으면 무한 루프에 빠지게 된다.</p>
42+
<h3>재귀를 활용한 DFS</h3>
43+
<pre>
3444
<code class="lang-java">
3545
class Solution {
3646

@@ -54,21 +64,21 @@ <h3>재귀를 활용한 DFS</h3>
5464
}
5565
</code>
5666
</pre>
57-
<h3>DFS를 활용하여 풀 수 있는 문제</h3>
58-
<ul>
59-
<li>모든 경우의 수를 구해야 하는 문제</li>
60-
<li>검색 대상의 규모가 큰 문제</li>
61-
<li>경로의 특징을 저장해야 하는 문제</li>
62-
</ul>
63-
<br><br>
64-
<h2>BFS (Breadth-Firsh Search)</h2>
65-
<br>
66-
<p>너비 우선 탐색이라고 부르며, 그래프에서 인접한 노드를 모두 탐색하고 다음 노드를 탐색하는 알고리즘이다. 이것은
67-
큐와 반복문을 이용하여 구현할 수 있다.</p>
68-
<p>
69-
<img src="/images/algorithm/bfs.gif" alt="bfs.gif"></p>
70-
<p>큐를 활용한 BFS</p>
71-
<pre>
67+
<h3>DFS를 활용하여 풀 수 있는 문제</h3>
68+
<ul>
69+
<li>모든 경우의 수를 구해야 하는 문제</li>
70+
<li>검색 대상의 규모가 큰 문제</li>
71+
<li>경로의 특징을 저장해야 하는 문제</li>
72+
</ul>
73+
<br><br>
74+
<h2>BFS (Breadth-Firsh Search)</h2>
75+
<br>
76+
<p>너비 우선 탐색이라고 부르며, 그래프에서 인접한 노드를 모두 탐색하고 다음 노드를 탐색하는 알고리즘이다. 이것은
77+
큐와 반복문을 이용하여 구현할 수 있다.</p>
78+
<p>
79+
<img src="/images/algorithm/bfs.gif" alt="bfs.gif"></p>
80+
<p>큐를 활용한 BFS</p>
81+
<pre>
7282
<code class="lang-java">
7383

7484
public static void bfs(int start) {
@@ -95,21 +105,22 @@ <h2>BFS (Breadth-Firsh Search)</h2>
95105
</code>
96106
</pre>
97107

98-
<h3> 활용하여 풀 수 있는 문제</h3>
99-
최단 경로 찾는 문제
108+
<h3> 활용하여 풀 수 있는 문제</h3>
109+
최단 경로 찾는 문제
100110

101-
<h3>연습 문제</h3>
102-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/1844#">프로그래머스 - 게임 맵 찾기</a></p>
103-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/49994#">프로그래머스 - 방문 길이</a></p>
104-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/84512">프로그래머스 - 모음 사전</a></p>
105-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/87946#">프로그래머스 - 피로도</a></p>
106-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/43165#">프로그래머스 - 타겟 넘버</a></p>
107-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/72411">프로그래머스 - 메뉴 리뉴얼</a></p>
108-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/42839">프로그래머스 - 소수 찾기</a></p>
109-
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/12977">프로그래머스 - 소수 만들기</a></p>
111+
<h3>연습 문제</h3>
112+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/1844#">프로그래머스 - 게임 맵 찾기</a></p>
113+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/49994#">프로그래머스 - 방문 길이</a></p>
114+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/84512">프로그래머스 - 모음 사전</a></p>
115+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/87946#">프로그래머스 - 피로도</a></p>
116+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/43165#">프로그래머스 - 타겟 넘버</a></p>
117+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/72411">프로그래머스 - 메뉴 리뉴얼</a></p>
118+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/42839">프로그래머스 - 소수 찾기</a></p>
119+
<p><a href="https://programmers.co.kr/learn/courses/30/lessons/12977">프로그래머스 - 소수 만들기</a></p>
110120

111-
</section>
121+
</section>
112122
</main>
123+
<div th:replace="~{fragments/footer.html::footer}"></div>
113124
<script src="../../static/Js/header.js" th:src="@{/Js/header.js}"></script>
114125
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
115126
<script>hljs.highlightAll();</script>

src/main/resources/templates/algorithm/setsAndMaps.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1 class="title">집합(Set)과 맵(Map)</h1>
3232
<section class="content-main">
3333
<h2 class="a11y">퀴즈 게시판 본문 내용</h2>
3434
<div class="content-detail">
35-
<img src="/images/codingtest/HJhello.gif" style="width:200px; height:200px;"><br><br>
35+
<img src="/images/algorithm/HJhello.gif" style="width:200px; height:200px;"><br><br>
3636
안녕하세요! <br>
3737
오늘은 자바에서 사용되는 매우 유용한 자료구조인 <strong>집합(Set)과 맵(Map)</strong>에 대해 알아보겠습니다.<br><br>
3838

@@ -225,7 +225,7 @@ <h3>맵(Map)의 특징과 사용법</h3><br>
225225
점차
226226
직관적으로
227227
어떤 자료구조를 사용해야 할지 감이 올 것입니다.</p><br><br>
228-
<img src="/images/codingtest/HJcheerup.gif" style="width:200px; height:200px;">
228+
<img src="/images/algorithm/HJcheerup.gif" style="width:200px; height:200px;">
229229
<p>처음이라 어렵더라도 포기하지 말고 꾸준히 연습해 보세요. 곧 자연스럽게 집합과 맵을 활용하여 문제를 해결할 수 있게 될 것입니다!</p>
230230
</div>
231231

src/main/resources/templates/algorithm/timeComplexity.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h1 class="title">시간 복잡도</h1>
3636
<section class="content-main">
3737
<h2 class="a11y">퀴즈 게시판 본문 내용</h2>
3838
<div class="content-detail">
39-
<img src="/images/codingtest/hello.gif" style="width:200px; height:200px;"><br><br>
39+
<img src="/images/algorithm/hello.gif" style="width:200px; height:200px;"><br><br>
4040
&nbsp;안녕하세요. 앞으로 코딩테스트에 대해 알려드릴 도우미라고 합니다!<br>
4141
오늘은 코딩테스트에서 기본이 되는 시간복잡도에 대해 알려 드릴게요.<br><br>
4242

@@ -45,7 +45,7 @@ <h2 class="a11y">퀴즈 게시판 본문 내용</h2>
4545
실행해보고 실행시간을 측정하면 되죠! 제일 정확한 방법입니다.<br><br>
4646

4747
&nbsp;그렇다면 프로그램을 수행해보지 않고도 쉽게 아는 방법은 없을까요? 그래서 나온 개념이 시간복잡도 입니다.<br><br>
48-
<img src="/images/codingtest/timelimit.png"><br>
48+
<img src="/images/algorithm/timelimit.png"><br>
4949
<div style="color: #00a3d2; font-size:12px; margin-top:-10px;">&nbsp;&nbsp;&nbsp;&nbsp;문제에는
5050
시간과 공간의 제한이 존재한다.
5151
</div>
@@ -105,7 +105,7 @@ <h3>"시간 복잡도로 프로그램을 직접 실행시키지 않고도 대략
105105
이제 등장할 빅오라는 개념에서 3n+4 에서 3과 4는 중요하지 않아요.<br>
106106
이유는 n이 상당히 클 경우 n+3, 23*n+21, n^2, 23*n^2+21은 결국<br>
107107
n < nlogn < n^2 < n^3 같이 대표적인 클래스에 따라 값의 크기가 결정 되기 때문이에요.<br><br>
108-
<img src="/images/codingtest/bigo.png" style="width:300px; height:300px;"><br>
108+
<img src="/images/algorithm/bigo.png" style="width:300px; height:300px;"><br>
109109
<div style="color: #00a3d2; font-size:12px; margin-top:2px;">&nbsp;n값이 커지면 결국 계수나 상수와 상관 없이
110110
대표적인 클래스에 해당하는 비교가 된다.
111111
</div>

src/main/resources/templates/codingTest/board.html

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,66 @@
11
<!DOCTYPE html>
22
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
33
<head>
4-
<meta charset="UTF-8">
5-
<title>Doumi</title>
6-
<link href="../../static/css/fragments/footer.css" th:href="@{/css/fragments/footer.css}" rel="stylesheet" type="text/css"/>
7-
<link rel="stylesheet" href="https://uicdn.toast.com/editor/3.0.2/toastui-editor.min.css">
8-
<link href="../../static/css/board.css" th:href="@{/css/board.css}" rel="stylesheet" type="text/css"/>
9-
<link href="../../static/css/fragments/header.css" th:href="@{/css/fragments/header.css}"
10-
rel="stylesheet"
11-
type="text/css"/>
12-
<link href="../../static/css/codingtest/header.css" th:href="@{/css/codingtest/header.css}" rel="stylesheet" type="text/css"/>
4+
<meta charset="UTF-8">
5+
<title>Doumi</title>
6+
<link href="../../static/css/fragments/footer.css" th:href="@{/css/fragments/footer.css}"
7+
rel="stylesheet" type="text/css"/>
8+
<link rel="stylesheet" href="https://uicdn.toast.com/editor/3.0.2/toastui-editor.min.css">
9+
<link href="../../static/css/board.css" th:href="@{/css/board.css}" rel="stylesheet"
10+
type="text/css"/>
11+
<link href="../../static/css/fragments/header.css" th:href="@{/css/fragments/header.css}"
12+
rel="stylesheet"
13+
type="text/css"/>
14+
<link href="../../static/css/codingtest/header.css" th:href="@{/css/codingtest/header.css}"
15+
rel="stylesheet" type="text/css"/>
1316
</head>
1417
<body>
1518
<div th:replace="~{fragments/header.html::header}"></div>
1619
<main class="cont-main">
17-
<input class="post-id hidden" th:value="${cote.id}"/>
18-
<input class="type hidden" th:value="${cote.postType}"/>
20+
<input class="post-id hidden" th:value="${cote.id}"/>
21+
<input class="type hidden" th:value="${cote.postType}"/>
1922

20-
<section class="content-header">
21-
<a class="back-button" onclick="clickHistoryBack()">< 목록으로 </a>
22-
<h1 class="title" th:text="${cote.title}"></h1>
23-
<div class="content-info-container">
24-
<div class="content-info">
25-
<span class="board-writer-name" th:value="${cote.userId}" th:text="${cote.author}"></span>
26-
<p class="content-createdAt" th:text="${#dates.format(cote.createdAt,'yyyy-MM-dd HH:mm')}"></p>
27-
</div>
28-
<th:block th:if="${userName} eq ${cote.author}">
29-
<div class="content-edit-container">
30-
<button onclick="editContent()">수정</button>
31-
<button onclick="deleteContent()">삭제</button>
32-
</div>
33-
</th:block>
23+
<section class="content-header">
24+
<a class="back-button" onclick="clickHistoryBack()">< 목록으로 </a>
25+
<h1 class="title" th:text="${cote.title}"></h1>
26+
<div class="content-info-container">
27+
<div class="content-info">
28+
<span class="board-writer-name" th:value="${cote.userId}" th:text="${cote.author}"></span>
29+
<p class="content-createdAt"
30+
th:text="${#dates.format(cote.createdAt,'yyyy-MM-dd HH:mm')}"></p>
31+
</div>
32+
<th:block th:if="${userName} eq ${cote.author}">
33+
<div class="content-edit-container">
34+
<button onclick="editContent()">수정</button>
35+
<button onclick="deleteContent()">삭제</button>
3436
</div>
35-
</section>
36-
<section class="content-main">
37-
<h2 class="a11y">퀴즈 게시판 본문 내용</h2>
38-
<div class="content-detail"></div>
39-
<button class="likes-button content-likes" onclick="clickLike(this, 'POST')">
40-
<input class="post-id hidden" th:value="${postId}"/>
41-
<img th:class="${cote.liked} ? 'liked' : 'like-img'" th:src="@{/images/icon_like_normal.png}" alt="좋아요 버튼">
42-
<p class="likes-number" th:text="${cote.likeCount}"></p>
43-
</button>
44-
</section>
45-
<section class="comment-container">
46-
<div th:replace="~{comment/comment.html::comment-header}"></div>
47-
<div th:replace="~{comment/comment.html::comment-main}"></div>
48-
</section>
37+
</th:block>
38+
</div>
39+
</section>
40+
<section class="content-main">
41+
<h2 class="a11y">퀴즈 게시판 본문 내용</h2>
42+
<div class="content-detail"></div>
43+
<button class="likes-button content-likes" onclick="clickLike(this, 'POST')">
44+
<input class="post-id hidden" th:value="${postId}"/>
45+
<img th:class="${cote.liked} ? 'liked' : 'like-img'" th:src="@{/images/icon_like_normal.png}"
46+
alt="좋아요 버튼">
47+
<p class="likes-number" th:text="${cote.likeCount}"></p>
48+
</button>
49+
</section>
50+
<section class="comment-container">
51+
<div th:replace="~{comment/comment.html::comment-header}"></div>
52+
<div th:replace="~{comment/comment.html::comment-main}"></div>
53+
</section>
4954
</main>
5055

5156
<div th:replace="~{fragments/footer.html::footer}"></div>
5257

58+
<script src="../../static/Js/header.js" th:src="@{/Js/header.js}"></script>
5359
<script src="https://uicdn.toast.com/editor/3.0.2/toastui-editor-all.min.js"></script>
5460
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
5561
<script th:src="@{/Js/codingTest/board.js}"></script>
5662
<script th:inline="javascript">
57-
let coteContent = [[${cote.contents}]];
63+
let coteContent = [[${cote.contents}]];
5864
</script>
5965
<script th:src="@{/Js/wordCount.js}"></script>
6066
<script th:inline="javascript" th:src="@{/Js/codingTest/viewer.js}"></script>

0 commit comments

Comments
 (0)