분류 전체보기
-
[알고리즘][개념] Selection sort, Insertion Sort, Merge Sort, Quick sort개발 이야기/알고리즘 및 코테 준비 2024. 9. 18. 22:10
정렬 알고리즘은 사실 실제로는 코테 때 나는 아직 사용해본적은 없지만 수업 1주차 때 관련 내용이 나오기도 했고, 간단히 코드와 원리, 시간복잡도에 관해 이야기해보려고 한다. 기본적으로 이 글에서는 오름차순으로 정렬된 배열이 정렬 되어있다고 할 것이다. https://hsp1116.tistory.com/33 을 참고하여 작성하였습니다.Selection Sort(선택 정렬)선택 정열은 이름 그대로 배열을 처음부터 끝까지 훑으면서 가장 작은 (또는 큰) 값을 선택하여 맨 앞자리 (또는 뒷자리)로 옮기는 방식이다. 시간 복잡도: O(n^2) (최선, 평균, 최악 모두)장점: 구현이 매우 간단합니다.단점: 시간 복잡도가 높아 큰 데이터셋에는 비효율적입니다. def selection_sort(arr): ..
-
[알고리즘][개념] DFS(깊이 우선 탐색) & BFS(너비 우선 탐색)개발 이야기/알고리즘 및 코테 준비 2024. 9. 18. 15:28
https://devuna.tistory.com/32, 튜나 개발일기를 참고하였습니다. 여러 자료구조 중 그래프를 탐색하는 방법에는 크게 깊이 우선 탐색, DFS와 너비 우선 탐색인 BFS가 존재한다. 여기서 말하는 그래프란 node와 edge로 구성된 자료구조를 말한다. 이 중 방향성이 있는 비순환 그래프를 트리라고 말한다. 이런 그래프를 탐색한다는 의미는 하나의 정점으로부터 시작하여 차례대로 모든 정점을 하나씩 방문하는 것을 의미한다. 코테 문제 중 일부는 이런 search 기법을 잘 구현해야하기에 DFS와 BFS의 개념을 알아보고 python으로 주어진 그래프를 간단히 탐색해보는 예제코드를 작성해보려고 한다. 깊이 우선 탐색(DFS, Depth-First Search): 우선 최대한 깊이 내려..
-
[DBMS] DataModeling - ER model 중심으로개발 이야기/DB(데이터베이스) 2024. 9. 16. 22:10
본 내용은 한양대학교 차재혁 교수님의 데이터베이스시스템및응용 수업(11710)과 Rebro의 코딩일기장의https://rebro.kr/143과 https://basic-theory.tistory.com/6 https://victorydntmd.tistory.com/126 내용을 참고하여 작성하였습니다. Steps in DB Design 아래 흐름에 맞추어서 DB design은 이루어진다. Requirements Analysis •user needs; what must database do?Conceptual Design •high level description (often done w/ER model) •Object Relational Mappings (ORMs: Hiberna..
-
[DBMS] 데이터베이스 Overview개발 이야기/DB(데이터베이스) 2024. 9. 10. 21:01
본 내용은 한양대학교 차재혁 교수님의 데이터베이스시스템및응용 수업(11710)과 Rebro의 코딩일기장의https://rebro.kr/143 내용을 참고하여 작성하였습니다. DBMS Database Management system 이란? 데이터베이스는 매우 큰 통합된 데이터의 모음이다. Database Management system은 이런 Database를 저장하고 유지하기 위한 소프트웨어 패키지이다(정의, 생성, 질의, 업데이트, 관리)Files vs DBMS왜 DBMS가 필요한가? Application이 사용하는 File 시스템과 DB 시스템을 비교하면 아래와 같다. 1. Application must stage large datasets between main memory and secondar..
-
[Python][자료구조] 2차원 배열 선언개발 이야기/Python 2024. 9. 9. 21:53
https://blog.sysbot32.com/entry/Python-2%EC%B0%A8%EC%9B%90-%EB%B0%B0%EC%97%B4-%EC%84%A0%EC%96%B8%ED%95%98%EA%B8%B0 [Python] 2차원 배열 선언하기※ 2021년 12월 19일에 작성된 글입니다.Python에서의 1차원 배열 선언Python에서 1차원 배열을 선언할 때는 다음과 같이 * 연산자를 이용해 간단하게 선언할 수 있다.rows = 10arr = [0] * rows[0, 0, 0, 0, 0, 0, 0blog.sysbot32.com 문제를 풀다보면 2차원 배열을 선언해야 할 일이 종종 있는데, 아이디어 자체는 어렵지 않다. 중요한건 [[]]에서 첫번째가 행을 결정한다는 것이다. 저번에 한번 아래와 같이 [..
-
[Softeer][21년 재직자 대회 예선] 좌석관리개발 이야기/알고리즘 및 코테 준비 2024. 9. 9. 20:24
Level 3가 되더니 확실히 난이도가 올라갔다. 푸는데 생각보다 많은 시간이 소요된 문제였다.다만 몇몇 아이디어들은 계속해서 사용되는 형식이라 중요한 문제이다.(상하좌우 확인)문제 https://softeer.ai/practice/6267 Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai현대자동차그룹에서 사내 식당 매니저로 일하는 기항이는 점심 시간에 맞춰 일을 하고 있다. 오늘 일은 사람들이 사회적 거리두기를 잘 지키면서 식당 좌석에 앉도록 상황을 관리하는 일이다.현재 식당에는 좌석 N×M개가 N행 M열로 나열되어 있는데, 각 좌석에는 (1,1)에서 (N,M)로 좌표가 배정되어 있다. x행 y열에 있는 좌석의 좌표는 (x,y)이다.점심 시간에는 많은 사람들이 식당을 드나든다. 사번..
-
[Softeer][21년 재직자 예선] 회의실 예약개발 이야기/알고리즘 및 코테 준비 2024. 9. 9. 19:44
문제https://softeer.ai/practice/6266 Softeer - 현대자동차그룹 SW인재확보플랫폼 softeer.ai회사에는 N개의 회의실이 있다. 수많은 팀이 모여 토론하고 업무를 처리하기 위해서는 회의실이 필수적이다.내부망에 아주 간단한 회의실 예약 시스템이 있지만 편의성이 매우 떨어진다. 단순히 예약된 회의의 목록만 표시되기 때문에, 방 별로 비어 있는 시간이 언제인지를 확인하기가 힘든 것이다. 당신은 이를 직접 해결해 보기로 마음 먹었다.회의실 이용 규칙은 다음과 같다:- 회의실은 9시부터 18시까지만 사용 가능하다. 모든 회의의 시간은 이 안에 완전히 포함되어야 한다.- 회의는 정확히 한 회의실을 연속한 일정 시간 동안만 점유한다. 즉 각 회의는 (회의실, 시작 시각, 종료 시각)..
-
[Softeer][21년 재직자 대회 예선] 전광판 문제개발 이야기/알고리즘 및 코테 준비 2024. 9. 4. 22:07
문제 전광판은 최대 다섯 자리의 자연수만을 표시할 수 있도록, 아래와 같이 육각형 모양의 전구 7×5=35개로 구성되어 있다.각각의 전구에는 스위치가 달려 있다. 전구에 달려 있는 스위치를 누를 때, 그 전구가 켜져 있었다면 꺼지고, 그 전구가 꺼져 있었다면 켜진다. 지금 전광판에 자연수 A가 표시되어 있는데, 유가가 변동됨에 따라 전광판에 표시된 자연수를 B로 바꿔야 한다. 이러한 목표를 달성하기 위해 스위치를 최소 몇 번 눌러야 하는지를 구하는 프로그램을 작성하라. 제약조건하나의 입력에서 1개 이상 1000개 이하의 테스트 케이스를 해결해야 한다.A와 B는 한 자리 이상 다섯 자리 이하의 자연수이다.A와 B는 숫자 0으로 시작하지 않는다.A와 B는 서로 다르다.입력형식첫 번째 줄에 해결할 테스트 케이..