본문 바로가기

알고리즘(C언어)/알고리즘 및 실습 강의14

(9)실습7주차_이진탐색트리_전위순회,삽입,삭제_이론+코드[문제1] #문제 PDF 파일 :[문제1] :#알아야 할 개념 (요약) :이진 트리 전위(중위 후위에서도 마찬가지) 순회 메소드 구현에서 if구현 실수 조심이진 탐색 트리의 삽입 메소드와 삭제 메소드는 이중포인터를 매개변수로 한다.이진 탐색 트리의 삭제 메소드 논리 전개(이건 시발 계속해도 까먹음)1_ 전위 순회 구현 중 L과 R 구현에서 if만 쓰고 else를 쓰지 않도록 한다. 자주하는 실수1234567891011//이진 탐색 트리 전위 순회 메소드 D L Rvoid PrintTree(BTree* tree){    if (tree == NULL) return;     printf(" %d", tree->data);     if (tree->Left != NULL) PrintTree(tree->Left);    .. 2024. 9. 14.
(8)실습6주차_이진탐색+순차자료_[문제3](작성중) ※문제 PDF는 다음 링크에 들어가면 다운받을 수 있다.https://kojammin.tistory.com/95#include stdlib.h>#pragma warnin" data-og-host="kojammin.tistory.com" data-og-source-url="https://kojammin.tistory.com/95" data-og-url="https://kojammin.tistory.com/95" data-og-image="https://scrap.kakaocdn.net/dn/nDAQM/hyW2WFlCuK/9cZRt513NwrfWAa5InuGwk/img.png?width=800&height=1050&face=0_0_800_1050,https://scrap.kakaocdn.net/dn/bECy.. 2024. 9. 11.
(7)실습6주차_이진탐색+순차자료_[문제2] [문제2]의 PDF는 아래의 링크에 들어가면 된다.https://kojammin.tistory.com/95#include stdlib.h>#pragma warnin" data-og-host="kojammin.tistory.com" data-og-source-url="https://kojammin.tistory.com/95" data-og-url="https://kojammin.tistory.com/95" data-og-image="https://scrap.kakaocdn.net/dn/5r6eY/hyWY8ghQ2n/AVRU2nt01qRz28fHtISL7K/img.png?width=800&height=1050&face=0_0_800_1050,https://scrap.kakaocdn.net/dn/vIi4Y/h.. 2024. 9. 10.
(6)실습6주차_이진탐색+순차자료_[문제1] [문제1]##이진탐색_순차자료(배열)_노트 :이론 : 시간복잡도 : O(logN)   ##코드 : 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#include stdio.h>#include stdlib.h>#pragma warning (disable : 4996) int* A = NULL;int result = -1; void BinarySearch(int* A, int start, int end, int key){    //1_ 종료조건★ start > end    if (start > end)return;     //2_ mid인덱스 저장    int mid = (sta.. 2024. 9. 10.