본문 바로가기 메뉴 바로가기

더 나은 프로그래머가 되기 위하여.

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

더 나은 프로그래머가 되기 위하여.

검색하기 폼
  • Trash (25)
    • Programming (25)
      • 뇌를 자극하는 알고리즘 (25)
  • 방명록

Programming/뇌를 자극하는 알고리즘 (25)
뇌를 자극하는 알고리즘 - 6. 탐색 : 순차 탐색(Sequential Search) - 전진이동법(Move To Front Method), 전위법(Transpose Method)

구현소스 LinkedList.h #ifndef LINKEDLIST_H #define LINKEDLIST_H #include #include typedef int Element; typedef struct tagNode{ struct tagNode *NextNode; Element Data; } Node; Node* SLL_CreateNode(Element NewData); // 노드 생성 void SLL_DestroyNode(Node* Node); // 노드 파괴 void SLL_AppendNode(Node** Head, Node* NewNode); // 노드를 추가하는 함수 - 링크드 리스트 젤 끝(tail)에 추가 void SLL_RemoveNode(Node** Head, Node* Remove);/..

Programming/뇌를 자극하는 알고리즘 2010. 10. 20. 23:40
뇌를 자극하는 알고리즘 - 5. 정렬 : Quick Sort - qsort함수의 활용

구현소스 #include #include #include int Compare(const void* _elem1, const void* _elem2) { int* elem1 = (int*)_elem1; int* elem2 = (int*)_elem2; // 오름차순으로 정렬하도록.. if(*elem1 > *elem2) return 1; else if(*elem1 < *elem2) return -1; else return 0; } void PrintArray(int Data[], int Length){ int i=0; int count=0; printf(" ---- Data ----\n"); for(i=0;i

Programming/뇌를 자극하는 알고리즘 2010. 10. 13. 15:30
뇌를 자극하는 알고리즘 - 4. 트리 : Expression Tree

구현소스 ExpressionTree.h #ifndef EXPRESSION_TREE_H #define EXPRESSION_TREE_H #include #include #include typedef double Element; typedef struct tagETNode { struct tagETNode* Left; struct tagETNode* Right; Element Data; } ETNode; // 노드생성 ETNode* ET_CreateNode(Element NewData); // 노드 파괴 void ET_DestroyNode(ETNode* Node); // 수식 트리 파괴 - 후위순회 void ET_DestroyTree(ETNode* Root); // 전위 순회 void ET_PreorderPr..

Programming/뇌를 자극하는 알고리즘 2010. 10. 13. 15:26
뇌를 자극하는 알고리즘(Data Structures In C) - 5. 정렬 : Quick Sort

구현소스 QuickSort.h #ifndef QUICKSORT_H #define QUICKSORT_H #include void Quick_Sort(int Data[], int left, int right, int size); int Partition(int Data[], int left,int right); void Swap(int *a, int *b); void Print_Array(int Data[], int size); #endif ------------------------------------------------------------------ QuickSort.cpp #include "QuickSort.h" void Print_Array(int Data[], int size){ int i; ..

Programming/뇌를 자극하는 알고리즘 2010. 10. 13. 00:47
뇌를 자극하는 알고리즘 - 5. 정렬 : Insertion Sort

구현 소스 InsertionSort.h #ifndef INSERTIONSORT_H #define INSERTIONSORT_H #include #include void InsertionSort(int Data[], int size); #endif -------------------------------------------------------------------- InsertionSort.cpp #include "InsertionSort.h" void InsertionSort(int Data[], int size){ int i; int j; int value; int k; for(i=1 ; i

Programming/뇌를 자극하는 알고리즘 2010. 10. 11. 23:30
뇌를 자극하는 알고리즘 - 5. 정렬 : Bubble Sort

구현 소스 BubbleSort.h #ifndef BUBBLESORT_H #define BUBBLESORT_H #include void BubbleSort_Ascending(int Data[], int size); void BubbleSort_Descending(int Data[], int size); int IsSorting_Ascending(int Data[], int size); int IsSorting_Descending(int Data[], int size); #endif ------------------------------------------------------------------------- BubbleSort.cpp #include "BubbleSort.h" void BubbleSor..

Programming/뇌를 자극하는 알고리즘 2010. 10. 11. 23:24
뇌를 자극하는 알고리즘 - 4. 트리 : Simple Binary Tree

구현소스 BinaryTree.h #ifndef BINARYTREE_H #define BINARYTREE_H #include #include // SBT = Simple Binary Tree // Binary Tree는 Maximum Degree(- Node 가 가지는 Child Node의 개수) 가 2인 Tree이다. // - Binary Tree의 종류 // 1. Full Binary Tree - 포화 이진 트리 // : Leaf Node(Height[- 최대 Depth값]에 존재하는 Node)를 제외한 모든 Node가 Child Node를 2개씩 가지고 있다. // : Leaf Node들이 모두 같은 Depth[- Root노드에서 해당 Node까지의 경로의 길이]에 존재한다. // 2. Complet..

Programming/뇌를 자극하는 알고리즘 2010. 10. 7. 23:42
뇌를 자극하는 알고리즘 - 4. 트리 : Left Child Right Sibling

구현 소스 LCRSTree.h #ifndef LCRSTREE_H #define LCRSTREE_H #include #include typedef char Element; // Left child Right Sibling Tree Struct 선언 typedef struct tagLCRSNode{ struct tagLCRSNode* LeftChild; struct tagLCRSNode* RightSibling; Element Data; } LCRSNode; LCRSNode* LCRS_CreateNode(Element NewData); void LCRS_DestroyNode(LCRSNode* Node); void LCRS_DestroyTree(LCRSNode* Root); // DestroyTree 함수는 ..

Programming/뇌를 자극하는 알고리즘 2010. 10. 7. 23:34
뇌를 자극하는 알고리즘 - 3. 큐 : 링크드 리스트 큐

구현소스 LinkedListQueue.h #ifndef LINKEDLISTQUEUE_H #define LINKEDLISTQUEUE #include #include #include typedef struct tagNode{ char* Data; struct tagNode* NextNode; }Node; typedef struct tagLinkedQueue{ Node* Front; // 전단을 가리키는 포인터 Node* Rear; // 후단을 가리키는 포인터 int Count; // Node의 개수를 가짐 } LinkedQueue; void LQ_CreateQueue(LinkedQueue** Queue); // Queue 생성 void LQ_DestroyQueue(LinkedQueue* Queue); // ..

Programming/뇌를 자극하는 알고리즘 2010. 10. 5. 15:07
뇌를 자극하는 알고리즘 - 3. 큐 : 순환 큐

구현소스 CircularQueue.h #ifndef CIRCULARQUEUE_H #define CIRCULARQUEUE_H #include #include typedef int Element; // 데이터 구조체 typedef struct tagNode{ Element Data; }Node; typedef struct tagCircularQueue{ int Capacity; // 용량 (실제용량은 Capacity+1) int Front; // Front index int Rear; // Rear index Node* Nodes; // 데이터 구조체 배열 } CircularQueue; void CQ_CreateQueue( CircularQueue** Queue, int Capacity); // Queue ..

Programming/뇌를 자극하는 알고리즘 2010. 10. 5. 15:01
이전 1 2 3 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • Kinect Programming
  • 2D Game Project
  • quick sort
  • Win32 API
  • Hash table
  • WM_CONTEXTMENU
  • Data Structures in C
  • WinAPI
  • Linked list
  • Kinect Game Project
  • Digits Folding
  • 뇌를 자극하는 알고리즘
  • graph
  • Tales of the Float Land
  • 그림 맞추기 게임
  • SetTimer
  • Pixel 색상값으로 구현한 간단한 충돌
  • 열혈강의C
  • Game project
  • WM_TIMER
  • 윈도우즈 API 정복
  • IntersectRect
  • PackMan
  • MFC 예제
  • Tree
  • Stack
  • Queue
  • PtInRect
  • Farseer Physics
  • Ice Climber
more
«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바