Data Structures in C
Prof. J. So, Communications and Networking Lab (CNL), Department of Electronic Engineering, Sogang University
Copyright © 2019 J. So. All rights reserved. Not for distribution or reproduction.
Ch. 1 Basic Concepts
malloc(), sort(), binsearch(), Magic Square
- ex1-1.c // Dynamic Memory Allocation, malloc()
- ex1-2.c // Recursive function, factorial()
- ex1-3.c // Get the n numbers and show the result in ascending order, sort()
- ex1-4.c // CLKOCKS_PER_SEC to check the time complexity of sort()
- ex1-5.c // sort(), binsearch(), rbinsearch()
- ex1-6.c // sort() by using rand()
- ex1-7.c // Magic Square
Ch. 2 Arrays and Structures
2D array, string functions, KMP pattern matching
- ex2-1.c // 2D array acess, mat[2][3]
- ex2-2.c // 2D allocation, int **p, malloc()
- ex2-3.c // String functions
- ex2-4.c // String insert, strnins()
- ex2-5.c // KMP pattern matching, nfind()
Ch. 3 Stacks and Queues
Stack, Queue, Maze, Postfix, Infix
Ch. 4 Linked lists
Singly linked list, Phonebook
- ex4-1.c // Singly linked list: insert(), printList(), invert(), concatenate()
- ex4-2.c // Simple Phonebook (Textbook) - a new node will be inserted at the last
- ex4-3_stu.c // Linked list - a new node will be inserted at the proper position
- ex4-4.c // Sparse Matrices
Ch. 5 Trees
Tree - tree_display(), inorder(), postorder(), push(), pop(), iterInorder(), createNode()
Threaded Tree - insucc(), tinorder(), insertRight(), creadTree()
Binary search tree - search(), interSearch(), modifiedSearch(), tree_traversal()
Ch. 6 Graph
Depth first search, Breadth First Search: dfs(), bfs()
Dijkstra Algorithm
Bellman and Ford algorithm (weight can be negative)
- ex6-1_stu.c // Graph - Depth first search, Breadth First Search: dfs(), bfs()
- ex6-2_stu.c // Dijkstra Algorithm
- ex6-3.c // Bellman and Ford algorithm (weight can be negative)
- ex6-4.c // All Pairs Shortest Paths - allCosts()
Ch. 7 Sorting
Search - seqSearch(), binSearch()
Sorting - insertionSort(), bubbleSort(), quickSort()
#