1816 words
9 minutes
240630_Data_Structure_Basic001

link#




Summary#

Image

자료 구조Data Structures#

https://github.com/YoungHaKim7/c_project/tree/main/exercise/002stack

자료 구조(Well-known data structures)
유형(Type)컬렉션(Collection) , 컨테이너(Container)
추상ADT
Abstract Data Type
연관 배열(Associative array), 우선 순위 덱(Priority Deque), 덱(Deque), 리스트(List),
멀티맵, 우선순위 큐(Priority Queue), 큐(Queue),
집합 (멀티셋, 분리 집합),
스택(stack)
Associative array(Multimap, Retrieval Data Structure), List, StackQueue(Double-ended queue), Priority queue(Double-ended priority queue), Set(Multiset, Disjoint-set)
배열(Array)비트 배열(Bit Array), 환형 배열(Circular array), 동적 배열(Dynamic Array),
해시 테이블(Hash Table), 해시드 어레이 트리(Hashed Array Tree), 희소 배열(Sparse array)
연결형(Linked)연관 리스트(Association list),

연결 리스트(Linked List) - 단일연결(Singly Linked List), 이중연결(Doubly Linked List), 원형 연결(Circular Linked List)

Association list,
Linked list, Skip list, Unrolled linked list, XOR linked list
트리(Trees)B 트리,
이진 탐색 트리(AA, AVL, 레드-블랙, 자가 균형, splay)
힙(이진 힙, 피보나치) ,
R 트리( R*, R+, 힐버트),
트리(해시 트리)

B-tree, Binary search tree(AA tree, AVL tree, Red–black tree, Self-balancing tree, Splay tree),
Heap(Binary heap, Binomial heap, Fibonacci heap),
R-tree(R* tree, R+ tree, Hilbert R-tree), Trie Hash tree
그래프(Graphs)이진 결정 다이어그램
Binary decision diagram, Directed acyclic graph, Directed acyclic word graph


Big-O Cheat Sheet(그림으로 이쁘게)#

https://dev.to/deciduously/big-o-cheat-sheet-3i7d






Big-o-Cheat-sheet#

Screenshot 2024-10-08 at 9 58 03 PM

3_types_of_algorithms

big-o-cheat-sheet-poster

bio-o-

Big-O Cheat Sheet(그림으로 이쁘게) https://dev.to/deciduously/big-o-cheat-sheet-3i7d#


C언어 자료 구조 만들기#

https://youtu.be/1PFFgRcZLAk


유료) 그림으로 알고리즘 이랑 코드 비교해서 알려줌 최고#

https://log2base2.com/

struct node *head = NULL;
void addFirst(int val)
{
    struct node *newNode = malloc(sizeof(struct node));
    newNode->data = val;
    newNode->next = head;

    head = newNode;
}


void mirror(struct node *root){
    if(root == NULL)
        return;
    else
    {
        mirror(root->left);
        mirror(root->right);

        struct node *temp = root->left;
        root->left = root->right;
        root->right = temp;
    }
}
    




int *prt;

ptr = malloc(5 * sizeof(int));

ptr = realloc(ptr, 2 * sizeof(int));
ptr = realloc(ptr, 6 * sizeof(int));
    






https://log2base2.com/

Introduction to Programming and Data Structures#

https://youtu.be/4OGMB4Fhh50

C Programming & Data Structrues(Series)#

https://youtube.com/playlist?list=PLBlnK6fEyqRhX6r2uhhlubuF5QextdCSM

C Programming#

C Programming:

  1. Introduction to the course.
  2. Variables
  3. Global vs Local variables.
  4. Data types
  5. Operators in C
  6. Conditionals and loops
  7. Functions
  8. Recursion
  9. Pointers and arrays
  10. Strings
  11. Structure and union
  12. File Handling

Data Structures:

  1. Stacks
  2. Queues
  3. Linked list
  4. Trees
  5. Binary search trees
  6. Binary Heaps
  7. Graphs
  8. Tree Traversals

X - X - X




c언어로 만든 싱글 링크드 리스트 linked list ( 추가, 삽입 , 삭제) 백지부터 설명 시작#

https://youtu.be/3ZdafcIvREw



[📌연결 리스트 완전 정복 10] 이중 연결 리스트(doubly linked list) 역순 연결#


https://youtu.be/bWJma-gywpQ

자료구조란? | 배열(array) | 리스트(list) | 스택( stack) | 큐(queue) | 데큐(deque) | 트리(tree) | 그래프(graph) | 혀니C코딩|🔝|#

큰 분류장점단점쓰기 적합한 곳
1. 선형구조- 배열(array)Random Access
읽기전용이구만 ㅋㅋ
접속이 아주 많은 경우는
Array가 적합하다.
데이터에 접근할 일이 많은 경우
배열 중간에 있는거 꺼낼때
전체 copy와 move가
일어나서 성능 저하 ㅠㅠ
Overhead발생 ㅠㅠ
Overhead가 커질수록 성능 저하
읽기 전용이 무지 많은 곳
시작점 index[0]
- 리스트(list)
(단일, 이중, 원형)
Array단점 보완
중간삭제 추가시 Overhead가 X
오버헤드 없음(x)
중간 index번호100번같이 데이터 삭제 추가가
편하다.head하고 tail값만 수정해주면 됨. 대박 편함.
원소 하나하나가 따로 따로
Memory를 많이 사용함 ㅠㅠ
Random Access가 불가능
무조건 head부터
추적해서 들어가야한다. ㅠㅠ
데이터 추가 /삭제가
아주 많이 빈번한곳
시작점 head
- 스택
(stack)
메모장 복사하기 되돌리기 생각하면 됨
- 큐
(queue)
Printer출력
연결리스트가 성능이 좋다.
- 데크
(Deque)
stack+queue형태
앞뒤양쪽방향에서
추가,삭제가 가능
2. 비선형구조- 트리부모와 자식관계
방향이 존재하는
방향 그래프
시작점root
- 그래프시작점x
정해진 방향은x
네비게이션 생각하면 됨

array 배열|🔝|#

[1,  2,  3,  4,  5,  6]
[0] [1] [2] [3] [4] [5]
// index

Random Access가 가능

list리스트(head가 필요- 첫번째 원소의 주소가 저장됨)|🔝|#

  • 원형리스트는 null이 없다.(꼬리와 머리가 이어져 있기 때문에 ^^)
  • 다음 주소를 저장할 Pointer가 필요함
    • 마지막에 저장값이 없다면 tail에 null를 저장함
head에 시작 주소
       ┌-----┓       ┌-----┓
       | head|       | head|
       └┭----┘    ┌> └┭----┘
        ┌--┓      |   ┌--┓
node -> |1 |      |   |2 |
        └--┘      |   └--┘
       ┌--┴--┓    |  ┌--┴--┓   반복
       | tail| ---┘  | tail| ---┘
       └-----┘       └-----┘
       tail에는 다음 주소
       8 bytes

Stack스택(+)|🔝|#

  • 접시를 쌓는다 생각하면 됨 한쪽 방향으로만 데이터가 쌓임
    • LIFO(Last In First Out)

Pop(자료 뺄때, -)|🔝|#

  • 접시에서 상단부터 빼는거 생각하면 됨.stack과 pop
    • LIFO(Last In First Out)

큐queue(마트에서 줄서는거 생각하면됨)|🔝|#

데크(Deque)(스택과 큐가 합쳐진 형태)|🔝|#

Tree트리|🔝|#

           root
           1
        
        2     3

   4   5     6   7

Graph그래프(상위root가 없다.)|🔝|#

   자유로운 영혼들
   1     2     5

     3     4

Stack 자료구조 | C언어 코드 완벽 구현 | 배열을 이용한 스택 | 삽입(push), 삭제(pop), 출력(print), 초기화(clear) 혀니C코딩|🔝|#

240630_Data_Structure_Basic001
https://younghakim7.github.io/blog/posts/240630_data_structure_basic001/
Author
YoungHa
Published at
2024-06-30