본문 바로가기

알고리즘4

STL - 6 알고리즘 [STL-6]알고리즘|STL을 배우자2004.05.19 22:21라온(raon_pgm)카페매니저http://cafe.naver.com/cppstl/23 첨부파일(1)간단하게 vector를 지정하여 generic algorithm을 어떤 형태로 사용할 수 있는지 살펴 보도록 하겠습니다. Container 전부 generic algorithm을 사용할 수 있는 것은 아닙니다. 몇 몇 기능에 있어서는 Container 자체가 가지고 있는 algorithm은 더 좋은 성능을 보이는 경우도 있습니다. 대부분 동작은 iterator 즉 포인터를 받아 동작하게 됩니다. 시퀀스 컨테이너는 대부분 generic algorithm을 사용할 수 있으면 배열도 동일 하게 사용할 수 있습니다. 첨부는 algorithm에 있는 .. 2014. 2. 13.
검색 알고리즘 package search [ 검색에 사용될 기본 페킷 ]class _Set_Search [ 데이터를 산출하는 클래스 ] /*** * _Set_Search( int Data_su ) // 정수형의 크기만큼 배열을 생성한다. * _Data_Init() // 배열에 랜덤값을 넣는다. * _Data_Sort() // 퀵정렬을 이용 데이터를 정렬한다. * _Set_Key() // 검색할 값을 입력받는다. *_Show_Data() // 배열의 값을 화면에 보여 준다. ***/ import java.util.Scanner;public class _Set_Search extends java.util.Random { public int Data_len ; public int[] nDate ; public int Hei.. 2013. 6. 7.
SQRT의 최적화 속도가 느린 sqrt를 다양한 알고리즘으로 구현하여 테스트해 보았습니다. 1) ASMsqrt : FPU를 이용한 어셈코드__forceinline float ASMsqrt(float src) // FPU { float t; _asm { fld src; fsqrt; fstp t; } return t; } 2) fSQRT : GPG 책에 나오는 알고르즘#define SQRTTABLESIZE 256 /* Note: code below assumes this is 256. */ unsigned int ZSQRTTABLE[SQRTTABLESIZE] = { 531980127, 532026288, 532072271, 532118079, 532163712, 532209174, 532254465, 532299589, 53.. 2013. 5. 21.
알고리즘 관계복잡도 Big-O Complexity ChartExcellentGoodFairBadHorribleO(1), O(log n)O(n)O(n log n)O(n^2)O(2^n)O(n!)OperationsElementsKnow Thy Complexities!Hi there! This webpage covers the space and time Big-O complexities of common algorithms used in Computer Science. When preparing for technical interviews in the past, I found myself spending hours crawling the internet putting together the best, average, and wor.. 2013. 5. 14.