본문 바로가기

학과 공부/자료구조7

기말1 과제AVL.inI 6I 2I 9I 1I 5binary search tree를 만들자.AVL.outinorder preversal 출력preorder preversal 출력 결과하나씩 하나씩 그 다음에 avl 깨지는 부분 BN써주기AVL 트리 수정 없이그냥 최초 깨지는 부분 계속 2-3-4 Tree-every node has 2,3, or 4 children except leaves-all leaves are at the bottom level of the tree insertion(top-down)1) whenever insert encounters a 3-key node,the middle key is ejected and is placed in the parent node.2) If the root .. 2016. 11. 1.
DAY5 g하핳하하하하하하하핳하ㅏㅎㅎ하하하핳ㅎㅎ하ㅏㅏ -polynomial addition-sparse martrix->숙제 *Doubly linked list typedef struct list_node{ int data;struct list_node *left_next;struct list_node *right_next;}*list_pointer -Circular list->Singly circular list->Doubly circular list -inverting *tree(acyclic graph) 2016. 9. 27.
DAY4 ADT Quesue-Objects: a finite ordered list of elementsFunctions+Queue Create(max_size)+Boolean IsFull(Queue *Q) +Boolean IsEmpty(Queue *Q)+Boolean Add(Queue *Q, Element in)+Boolean Delete(Queue *Q, Element *out) Implementaton of Queue Queue Create(100) typedef struct{int item[100];int front=-1;int rear=-1 2,3에 채워져있다면front:1, rear:3 구현하기 나름 boolean IsFull(Queue *Q){return(Q->rear==99);//return(Q->.. 2016. 9. 20.
DAY3 -Virtual memory and pointer int a;//externalint main(){int b;//auto(지역변수)f(&b);} int f(int *);{int c;//autostatic int d;//static*p=100;} code-하드웨어에data-a,d; 하드웨어에stack-프로그램이 실행될때만 있다가 사라짐 c-f끝나면 사라짐p-f끝나면 사라짐,b의 주소 저장b-main끝나면 사라짐,여기에 100이 들어가게 된다.heap-프로그램이 실행될때만 있다가 사라짐 main(){int a[10];f(a);}f(int p[])//얘도 포인터 변수==int *p{p[2]=20;==*(p+2)==20;} 배열이름은 포인터 상수 a[i][j]==*(a[i]+j)==*(*(a+i)+j+) f(i.. 2016. 9. 13.
Day3 Big-O notation O : =θ : =o : T(n)∈O(n^2)T(n)∈Ω(n) g(n)∈O(f(n)), if there exists some positive real constant cand some non-negative integer Nsuch that for all n>=N, g(n)=N g(n)무한 g(n)/f(n)=0, g(n)∈o(f(n)) n이 커질수록 g(n)과 f(n)의 차이가 커진다.If lim n->무한 g(n)/f(n)=c, g(n)∈θ(f(n)) n이 커질수록 g(n)과 f(n)의 차이가 작아진다.Some properties f1∈O(g1) and f2∈O(g2) -> f1f2∈O(g1g2) -> f1+f2∈O(|g1|+|g2|)o(f)+o(f)⊆o(f)o(f)*o(g).. 2016. 9. 8.
DAY2 ProblemsTuring MachineBig -o notation ♠Problem ◇decision problem: 결정을 하는 문제 답이 ex) 0인지 1인지1/2보다 높은 확률보통은 확률 1로 해결했을때 ◇search problem: solution이 여러개 있고 그 중에 하나를 고를때 ex) Hamiltonian Circuit problemIn the mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path in an undirected or directed graph that visits each vertex exactly once. A Hamiltonian cycle (or Hamiltonian ci.. 2016. 9. 6.
DAY 1 자료구조ArrayQueue/StackLinked listbinary search treesortinggraph HW 30ME 30FE 30출석 10 2016. 9. 1.