전체 글
-
[Sort] Selection Sort (선택 정렬)Basic Programming/Algorithm 2018. 12. 11. 18:20
Selection Sort (선택 정렬) - Python - def selection_sort(collection): print('----- Selection Sort -----') print('input : ' + str(collection)) for i in range(len(collection)-1, 0, -1): pos_max = 0 for j in range (1, i+1): if collection[pos_max] < collection[j]: pos_max = j if(pos_max is not i): #if position is same, swap is unnecessary collection[pos_max], collection[i] = collection[i], collection[po..
-
StackBasic Programming/Data Structure 2018. 12. 11. 16:45
-- Python --class Stack(): def __init__(self): self.data = [] self.top = 0 #self.max = 100 def push(self, value): self.data.append(value) self.top += 1 def pop(self): if self.top is 0: print('Error. Stack is empty.') return self.top -= 1 data = self.data[self.top] del self.data[self.top] return data def peek(self): if self.top is 0: print('Error. Stack is empty') return return self.data[self.top..
-
[Sort] Insertion Sort (삽입 정렬)Basic Programming/Algorithm 2018. 12. 10. 18:49
Insertion Sort (삽입 정렬) - Python - def insertion_sort(collection): print('----- Insertion Sort -----') print('input : ' + str(collection)) for i in range(1, len(collection)): while 0 < i and collection[i] < collection[i-1]: collection[i], collection[i-1] = collection[i-1], collection[i] i = i - 1 print('progressing ... ' + str(collection)) return collection input = [3, 1, 6, 8, 4, 2, 9, 7, 10, 5]..
-
[Sort] Bubble Sort (버블 정렬, 거품 정렬)Basic Programming/Algorithm 2018. 12. 10. 18:42
Bubble sort (버블 정렬) Bubble sort is a basic sort algorithm.1. choose one object in the j(th) position in arraylist from the beginning.2. compare with the next object. If the chosen object is bigger than next object, swap objects. 3. Add one to j and increment to the end of the arraylist. Repeat this process until the end of arraylist.4. Repeat 1~3 process for length of array times. ** j (second l..
-
비트코인 시작(2)Others ... 2018. 1. 4. 15:08
으아아아아 첫번째 글을 요악하자면 이렇습니다. 총 40만원 투자. 중간에 갖은 우여곡절을 겪으면서 놀러코스터 타다가 55만 (당시 시세로) 정도가 되어서 20만원을 현금화시키고 35는 그대로 거래소에!! (그곳에... 내 모든것을 놔두고 왔다!!!!!!) ㅎㅎ 그런 사태가 있은 후 생각했습니다. 10월 말 쯤 되었던거 같네요. "아 이게.. 그냥하면 도박이랑 다를바가 없다.. 나만 투자라고 생각하지 다른 사람들은 전부 투기로 보겠구나" 그런 생각이 들고 나서 차트 공부를 시작했습니다. 기초적인 선긋기, 저점/고점 잡기 부터 시작해서 여러가지 지표 활용, 캔들분석, 15분, 30분봉부터 일봉, 주봉까지 참고하기. 하고나니까 생각보다 어렵지도 않고 별거 없었습니다.(진짜 전문가들처럼 미친듯이 차트보고 그런게..