분류 전체보기
-
[Python] 에라토스테네스의 체 (Sieve of Eratosthenes)Algorithm/Basic 2021. 4. 4. 22:00
1. 정의 - 2부터 시작하여, 소수인 경우 값을 출력하고, 해당 소수의 모든 배수들을 소거해 나가는 방법 2. 방법 - 2 -> 소수, N보다 작은 모든 2의 배수 제거 - 3 -> 소수, N보다 작은 모든 3의 배수 제거 - .... - k -> 소수, N보다 작은 모든 k의 배수 제거 예를들어, 20까지의 소수 구하기를 한다면, 2의 배수부터 20까지의 배수를 지워주는 방식이다. import time def isPrime(v): i = 2 while i*i = 2: primeList = list..
-
삼성SDS 코딩캠퍼스 봉사단 면접후기etc 2021. 4. 3. 12:57
비록 결과적으론 떨어졌지만, 다음 면접을 준비하시는 분들께 도움이 될까 싶어 블로그에 올려야 겠다고 생각했다. 뭔가 대외활동으로 자소서를 쓰기도 좋을 것같고, 이런 봉사 경험을 하는 게 더 좋을 것같아 지원하게 되었다. 오랜만에 본 면접이라 더 떨기도 떨고, 다른 면접자 분들이 너무 말씀을 잘하셔서 놀랐다. 나 취업할 수있겠지 .. ㅠ 일단 면접은 시국인만큼 줌으로 진행되었고, 대기실에 들어가있으면 2(면접관):4(지원자) 형식으로 소회의실로 따로 방이 만들어져 면접이 진행되었다 면접자 분들이 되게 웃으면서 말씀하셔서 긴장되는 분위기에도 괜찮았다! 일단 질문은 1. 자기소개와 지원동기 2. 초등학교 4학년에게 알고리즘이란 어떻게 설명할 것인지, 저에게 설명해주세요 3. 자신을 왜 봉사단에 뽑아야하는 지,..
-
E: Unable to locate package openjdk-8-jdk 해결삽질모음/에러해결 2021. 3. 30. 16:24
ubuntu 환경에서 java를 설치하려고 하니 처음 만나는 에러는 ,, 계속해서 찾아보니 위치 때문인걸 알게되었다😭 많은 사람들에게 도움이 되길 바라며 올려봅니다 cd /usr/local/bin /usr/local/bin 으로 들어간 후, java -version 을 쳤을 때, java 버전이 안나온다면 java가 깔리지 않았다는 것이므로 설치를 진행 할 수 있다. sudo apt-get update 모든 리포지토리 및 PPA에 대한 패키지 목록을 가져 와서 최신 상태인지 확인하는 명령어를 실행 시킨 후, sudo apt-get install openjdk-8-jdk java를 설치하면 정상적으로 설치되는 것을 볼 수 있다. 성공적으로 설치 후, 아래 명령어를 쳐봤을 때, 버전이 제대로 나온다면 설치 ..
-
02. 순환Computer Science/Data Structure 2021. 3. 24. 01:25
- 학습목표 순환의 개념을 이해한다 순환 알고리즘의 구조를 이해한다 순환 호출 시 주의사항을 이해한다 순환 호출 응용력을 배양한다 2.1 순환의 소개 순환? - 어떤 알고리즘이나 함수가 자기 자신을 호출하여 문제를 해결하는 기법 순환 알고리즘의 구조 - 순환 호출 하는 부분 - 순환 호출을 멈추는 부분 을 포함한다. 만일, 순환 호출을 멈추는 부분이 없다면, 무한정 호출하게 되어 서버가 다운될 수 있으므로 주의하여야한다. 순환과 반복 순환 recursion: 순환 호출을 이용 - 순환적인 문제에서 유리하다. - 함수 호출의 오버헤드가 있다. -> 순환 호출 시에는 호출이 일어날 때마다 호출하는 함수의 상태를 기억해야하기 때문에 여분의 기억장소가 필요하다. -> 비효율적인 경우가 많음 반복 iteratio..
-
01. 자료구조와 알고리즘Computer Science/Data Structure 2021. 3. 21. 14:02
- 학습목표 자료구조와 알고리즘의 개념을 이해한다 추상 자료형 도입의 필요를 이해한다 시간 복잡도의 개념을 이해한다 빅오 표기법에 의한 알고리즘 분석 기법을 이해한다 자료구조 표기법을 이해한다 1.1 자료구조와 알고리즘 자료구조란? - 사람들이 사물을 정리하여 저장하는 것과 마찬가지로 프로그램에서도 자료들을 정리하여 보관하는 여러 가지 구조들이 있다. 이러한 구조들을 자료구조라 한다. - 예를 들면, 해야할 일들을 중요도에 따른 내용들을 컴퓨터가 이해하려면 순차적으로 진행하는 List를 사용해야한다. 일상생활 자료구조 그릇, 연탄 스택 마트 계산대의 줄 큐 버킷 리스트 리스트 영어 사전 사전 지도 그래프 컴퓨터의 디렉토리 구조 트리 알고리즘이란? - 컴퓨터로 문제를 풀기 위한 단계적인 절차 - 특정한 일..
-
[Python] 유클리드 호제법(Euclidean Algorithm)Algorithm/Basic 2021. 3. 19. 18:46
1. 정의 - 두 수의 최대공약수를 구하는 알고리즘 2. 방법 - 2개의 자연수 a, b(a > b) 에 대해서 a를 b로 나눈 나머지를 r이라 하면, a와 b의 최대 공약수는 b와 r의 최대공약수와 같음 -> 이 성질에 따라, b를 r로 나눈 나머지 r'를 구하고, 다시 r을 r'로 나눈 나머지를 구하는 과정을 반복하여 나머지가 0이 되었을 때 나누는 수가 a와 b의 최대공약수가 된다. 3. 비교 유클리드 호제법이 아닌 다른 방법으로 코드를 작성한 후, 시간을 비교해보았습니다. 2초 가량 차이가 난다. 결론: 최대공약수를 구할 땐 유클리드 호제법을 이용하자
-
[Java] 백준 1110번 더하기 사이클Algorithm/백준 2020. 2. 19. 17:45
문제 접근방법 1. 새로운 수의 십의 자릿수 = input의 일의 자릿수 2. 새로운 수의 일의 자릿수 = ( input의 십의 자릿수 + input의 일의 자릿수 ) 의 일의 자릿수 3. 새로운 수 = input 멈추기 해결 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int input = Integer.parseInt(br.readLine()..