분류 전체보기 477

자료구조 | 수식 변환 계산 expression evaluation | postfix, prefix

Expression evaluation 파이썬 자료구조를 활용해서 수식을 계산해보자! 수식에는 + - * / 와 같은 연산자와 1 2 3 a b c와 같은 피연산자가 있다. 수식 = {연산자 operator} + {피연산자 operand} 이때 연산자는 산술 연산자(+ - / *), 논리 연산자(and or), 할당 연산자(=) 등이 있다. 수식을 표현하는 방식은 연산자의 위치에 따라 infix, postfix, prefix로 분류할 수 있다. infix notation 주로 사람이 쓰는 수식 표현 방식이다. a / b - c + d * e - a * c postfix notation 컴퓨터가 이해하기 위한 수식 표현 방식으로 연산자가 계산의 대상이 되는 피연산자 바로 뒤에 위치한다. infix nota..

MySQL | CRUD를 위한 기본 문법

쿼리 목록 CREATE DATABASE stock USE stock SHOW DATABASES SELECT * FROM stock_name CREATE TABLE stock_name ( Date DATE, Open float, High float, Low float, Close float, Volume INT ) DESC INSERT INTO %s (Date, Open, High, Low, Close, Volume)" % (stock_name) + "VALUES ('%s', %f, %f, %f, %f, %i) MySQL 구문 일반적으로 세미콜론을 붙인다. 대소문자를 구분하지 않는다. 주석 # 주석 -- 주석 /* 주석 */ 주요 구문 CREATE DATABASE CREATE TABLE INSERT INT..

Data Science 2021.12.28

자료구조 6-2장 | Linked List | 숙명여대 학점교류

학점교류로 듣는 숙명여대 자료구조 day 5. 2021.12.28. 화요일 to be continued..... :D linked stack and queue linked stack * isEmpty : 스택이 비어있는가? linear list에서 top, front로 isEmpty를 체크하였다. 고정 크기가 아닌 경우, 함수 length와 같은 것을 활용할 수 있다. head == None인 경우에 empty인 것이다 ~ 비어있을 때랑 비어있지 않을 때 코드가 달라져야 한다. * peek_front : 첫 원소를 본다(꺼내지 않음) * add_front : push * pop_front : pop linked stack의 구조 LIFO 정적 배열과 달리.. (파이썬은 아니지만..) 문제는 size를 정..

카테고리 없음 2021.12.28

자료구조 6장 | Linked List | 숙명여대 학점교류

학점교류로 듣는 숙명여대 자료구조 day 4. 2021.12.27. 월 Introduction Singly linked list linked stack and queue deque circular list doubly linked list Introduction list a list is a collection data type that has a sequence of elements ex) days of week, months of year linked list elements are physically distributed in memory logically sequential by link pointer # link 변수 variable list size easy to Create, insert, ..

자료구조 5-2장 | Linear Data Structure | 숙명여대 학점교류

학점교류로 듣는 숙명여대 자료구조 day 4. 2021.12.27. 월 INTRO 선형 큐를 리스트로 만들었다. 반면, Circular Queue는 None 만큼의 사이즈를 만들었다. Expression Evaluation 수식 변환 an expression consists of operator = arithmetic, logical, assignment operand = variable, constant types of expression notation depends on operator position against operand infix notation : a/b - c+d*e-a*c postfix notation : a b / c - d e * + a c * - prefix notation :..

Simple Data Structure | Queue, Circular Queue, Stack, N Queens Problem, fraction, prime number, fibonacci, bowling game, binary search

학점교류로 듣는 숙명여대 학점교류 자료구조 연습 Queue Circular Queue Stack N Queens Problem fraction prime number fibonacci bowling game permutation binary search hanoi tower Queue # queue class queue: # __init__ def __init__(self): self.que = [] # empty def empty(self): return len(self.que)==0 # size def size(self): return len(self.que) # enqueue def enqueue(self,data): self.que.append(data) # dequeue def dequeue(s..

태권도 겨루기 경기 규칙

1. 경기장 및 경기 방식 1) 국제 올림픽 위원회 (IOC) 정식 종목 태권도 WTF 세계 태권도 연맹, ITF 국제 태권도 연맹 품새 / 틀과 같이 용어와 기술, 규칙 등 차이 ITF 캐나다 중심 서구권 전파에 큰 영향 2) 8 * 8 팔각 경기장 주심 1명, 부심 4명 둘 중 한 선수의 두 발이 모두 경기구역에서 벗어나면 경고 3) 1경기는 2분씩 3회전 동점인 경우, 추가 2분 동안 먼저 득점한 선수 승리 1회전 초반 탐색, 3회전 체력 주요 관점 [관점 포인트] 2. 전자호구 1) 전자호구와 손과 발에 센서 부착형 체급, 성별, 헤드기어에 다른 감압센서 기준 설정 득점 및 반칙 1) 주먹으로 몸통 공격 1점 획득 주먹 공격은 몸통에만 가능 어깨 위에 들고 있거나, 앞 주먹은 득점 미인정 2) 발..

Life 2021.12.25

자료구조 5장 | Linear Data Structure | 숙명여대 학점교류

학점교류로 듣는 숙명여대 자료구조 day 3. 2021.12.24. 금 Linear DS Stack Queue Circular Queue Expression Evaluation Maze Problem Stack 스택 last in first out LIFO Stack and Queue special types of ordered list elements are inserted, deleted thru one end of stack, called top applications procedure call management expression evaluation Balanced Parenthesis (5+6)*(9+8)/(6+2) open close가 같아야 한다. Decimal to Binary 123(1..

자료구조 4강 | Recursion | 숙명여대 학점교류

학점교류로 듣는 숙명여대 자료구조 day 2. 2021.12.23. 목 day 3. 2021.12.24. 금 Recursion Introduction Factorial GCD Binary Search Fibonacci Numbers Hanoi Tower Permutation N Queens Problem Recursion Introduction a function is called by itself while running "divide & conquer" strategy possible when the same task is repeated with exit condition Iterative function with if-else or while can be rewritten in recursion ..