Computer Science 387

코딩테스트 기초 배열 Binary Search | 코드없는 프로그래밍

출처 코드없는 프로그래밍 코딩테스트, 기초, 배열 인터뷰 바이너리 서치 - YouTube array - binary search 배열이 정렬이 되어있는 상태에서 어떤 값을 찾아달라! 어떤 배열 [1,3,5,6,7,15,20]에서 15의 인덱스를 찾고자 한다면? #어떤 배열 [1,3,5,6,7,15,20]에서 15의 인덱스를 찾고자 한다면? def solution(s, a): index = 0 search_index = 0 while True: if a == s[search_index]: index = search_index break elif a < s[search_index]: search_index //= 2 else: search_index += len(s) search_index //= 2 ret..

코딩테스트 Arrays 이론 | 코드없는 프로그래밍

출처 - 코드없는 프로그래밍 인터뷰 배열 기초 - YouTube Array - 가장 간단한 자료 구조 array란 데이터들이 연속적으로 이어져있고 랜덤 엑세스를 지원하는 자료 구조를 말한다. * 랜덤 엑세스 - 인덱스를 통해 바로 접근할 수 있게 해준다. 배열 문제는 인덱스를 사용할 수 있다는 점을 중요하게 사용하게 됨. ex - array를 활용한 BackTracking (?) 기본적인 문제의 경우, sorting과 관련이 된다. sorting의 종류에는 heap sort / quick sort / merge sort가 있다. 배열이 stable하면 merge sort 배열이 unstable하면 quick sort, heap sort를 사용한다. 이때 stable한 것은, 정렬이 된 후에도 ABCDE ..

Back to 알고리즘! | 코딩테스트 연습 level 2- 124 나라의 숫자들

코딩테스트 연습 - 124 나라의 숫자 | 프로그래머스 (programmers.co.kr) 코딩테스트 연습 - 124 나라의 숫자 programmers.co.kr def solution(n): answer = '' # 3을 빼고 3을 나누는 것을 반복한다. listing = [ '4','1', '2'] repeat = 1 while True: if n < 3: answer+= listing[n] break else: if n % 3 == 0: answer += listing[0] n = n // 3 - 1 if n == 0: break else: answer += listing[n%3] n //= 3 if n == 0: break answer = answer[::-1] return answer print..

What is Docker Compose? | 도커 컴포즈를 알아보자 | 발표 자료

🐳 docker compose 🐙 🐳 index 🐙 🐳 What is docker compose?🐙 overview of docker compose 🐳 | 도커 컴포즈 공식 문서 (tistory.com) overview of docker compose 🐳 | 도커 컴포즈 공식 문서 참고 - https://docs.docker.com/compose/ Overview of Docker Compose docs.docker.com 참고 2 - Orientation and setup | Docker Documentation 도커 도큐먼트도 곁들이기 :) 🐳 overview of docker compose 🐳.. tomatolife.tistory.com 🐳 실습 🐙 what is Docker Compose? | 🐳..

overview of docker compose 🐳 | 도커 컴포즈 공식 문서 | 개념편

참고 - https://docs.docker.com/compose/ Overview of Docker Compose docs.docker.com 참고 2 - Orientation and setup | Docker Documentation 도커 도큐먼트도 곁들이기 :) 🐳 overview of docker compose 🐳 컴포즈는 여러 개의 도커 컨테이너를 돌릴 때 사용한다. 컴포드가 깔려있으면, YAML 파일로 전체 application의 서비스를 구성해서 각각을 실행시키는 것이 아니라 하나의 명령어로 여러 컨테이너로 구성된 서비스를 시작할 수 있다. $ docker-compose up 얘 하나면 끝! 컴포즈의 기능을 더 알아보려면 다음 링크에 들어가면 된다. the list of features. 그..

what is Docker Compose? | 🐳 도커 컴포즈를 알아보자 | 실습편

🐳 🐳 🐳 🐳 🐳 참고 - 얄팍한 코딩사전 : 가장 쉽게 배우는 도커 - YouTube 🐳 목표 🐳 도커, 도커 컴포즈를 안다. 개념 + 실습을 남에게 설명할 수 있다. 학습 목표 느낌~ 내일 동아리에서 도커 컴포즈를 발표해야 한다. ㅋㅋㅋㅋ. ^^. 🐳 시작하기 전에.. 🐳 나의 이해도를 점검해보자! 그동안 동아리에서 뭘 해봤나.. 뭔가 .. 이것저것 깔았다! 도커 깔기 도커 이미지로 mysql 다운 + 간단한 문법 하둡 + 스파크 spark ML 카프카 -> 그리고 컴포즈.. 그리고 이해가 부족한 것 같아서 데이터 엔지니어링 인프라도 공부를 해 보았다. 🐳 그리고 얄코! 🐳 얄코의 도커 실습 구조도 로컬 환경의 웹을 docker로 환경 구성을 한다! 🐳 docker image - node.js ㄴ🐳🐳..

[8.21] pygame_ 토마토 수학게임

나아진 점 : intro를 넣으려 함. 개선할 점 : intro를 만드느라 정작 메인 게임을 못 만듦 ㅋㅋ.. : 화면이 깜빡거림. #-*- coding: utf-8 -*-# ## import import random import sys import math import pygame from pygame import mixer import time from time import sleep from math import pi WINDOW_WIDTH = 800 WINDOW_HEIGHT = 500 ## 한글 폰트 불러오기 pygame.font.init() small_font = pygame.font.SysFont('malgungothic', 10) font = pygame.font.SysFont('malgun..

[8.13] 파이썬 pygame - 토마토 수학교실

#-*- coding: utf-8 -*-# import random import sys import math import pygame from pygame import mixer import time from time import sleep from math import pi WINDOW_WIDTH = 800 WINDOW_HEIGHT = 500 #한글 폰트 불러오기 pygame.font.init() font = pygame.font.SysFont('malgungothic', 20) #아이콘 불러오기 icon = pygame.image.load('tomato.png') pygame.display.set_icon(icon) VELOCITY = 7 MASS = 2 class Car: def __init__(s..

[8.11] 파이썬 pygame - 토마토 수학게임

파이썬 파이게임을 이용해서 만든 간단한 프로그램이다! pygame 모듈을 설치한 후에 첨부파일을 다운받으면 실행시킬 수 있다 :D #-*- coding: utf-8 -*-# import random import sys import math import pygame from pygame import mixer import time from time import sleep WINDOW_WIDTH = 800 WINDOW_HEIGHT = 500 #한글 폰트 불러오기 pygame.font.init() font = pygame.font.SysFont('malgungothic', 20) #토마토 불러오기 redtomato = pygame.image.load('tomatotomato.png') happytomato =..

[8.11] 파이썬 조합 문제

from itertools import combinations def solution(str, k): # k개의 수를 제거해서 만들 수 있는 숫자 찾기 # step 1. 문자열을 리스트로 바꾸기 mylist = list(str) # step 2. 그 중에 k개 빼고 고르기 mylist = list(combinations(mylist, len(mylist)-k)) # step 3. 그 중에 가장 큰 수 찾기 answer = [] for i in mylist: #두 요소를 합치기 answer.append(int(''.join(i))) # step 4. 문자열 형태로 반환하기 answer.sort() answer.reverse() return answer[0] # 그 중에 가장 큰 숫자 찾기 print(sol..