본문 바로가기

Computer/Algorithm3

[Algorithm] Selection sort, Insertion sort GiPyeong Lee selection_sort.c // studentID : A889056 // selection_sort.c // Algorithm_Hongik // // Created by GiPyeong Lee on 2015. 3. 3.. // Copyright (c) 2015년 com.devsfolder.Hongik. All rights reserved. // #include #include #include int tempArray[1000001]={0,}; // Container void selection_sort(int argc, const char * argv[]){ if ( argc 2015. 3. 4.
[Algorithm] 수행시간 측정 방법 향후 알고리즘의 시간 측정은 다음과 같은 방법으로 진행된다. #include #include int main(int argc, const char * argv[]) { // insert code here... clock_t start_time, end_time; // Time Variable Declare start_time = clock(); // Time to start // Here is Some Code end_time = clock(); // Time to end printf("Time : %f\n", ((double)(end_time-start_time)) / CLOCKS_PER_SEC); return 0; } Here is Some Code 라고 주석으로 명시한 부분에 내가 수행할 코드를 넣.. 2015. 3. 3.
알고리즘 기초 대전 멤버십 회원인 박태현씨의 알고리즘 기초 강좌에서 기억하고자 하는 내용들을 정리해본다. 1. for 문의 1억번은 1초이다.2. 알고리즘 문제는 100줄 이하로 풀 수 있다.3. 제한조건을 꼭 확인하라4. 전역변수는 배열크기 약 천만개까지 가능하다.5. 동적 메모리 할당은 시간을 잡아먹는다.6. cout보다 printf 가 훨씬빠르다. 에라토스테네스체: 1보다 큰 자연수 n 에 대하여 루트n 보다 작거나 같은 모든 소수가 n을 나누지 못하면 n은 소수이다. 다음은 윤필립씨의 피티 강의를 따라 가보겠다~ 1. 알고리즘이라는 것 무엇일까? => 어떤 작업을 수행하기 위해 입력을 받아 원하는 출력을 만들어내는 과정을 기술한 것 2. 좋은 알고리즘이란? => 빠르다.=> 메모리를 적게 먹는다.=> 알고리즘의.. 2015. 2. 11.
반응형