Basic implementaion of various data structures and algorithms in C++ and C, done as practice. WIP
- Clone the repository.
git clone https://github.com/acitate/DSA.git- Change to root directory.
cd DSA- modify
main.cpp. - Build and run.
make
./output/main-
Implement stack data structure.
-
Define LLStack struct for linked list based implementation.
- Implement 'stack_ll_create' function.
- Implement 'stack_ll_push' function.
- Implement 'stack_ll_peek' function.
- Implement 'stack_ll_pop' function.
- Implement 'stack_ll_is_empty' function.
- Implement 'stack_ll_size' function.
-
Define ArrayStack struct for array based implementation.
- Implement 'stack_arr_create' function.
- Implement 'stack_arr_push' function.
- Implement 'stack_arr_peek' function.
- Implement 'stack_arr_pop' function.
- Implement 'stack_arr_is_empty' function.
- Implement 'stack_arr_size' function.
-
-
Implement queue data structure
-
Define LLQueue struct for linked list based implementation.
- Implement 'queue_ll_create' function.
- Implement 'queue_ll_enqueue' function.
- Implement 'queue_ll_dequeue' function.
- Implement 'queue_ll_peek' function.
- Implement 'queue_ll_length' function.
-
Define ArrayQueue struct for array based implementation.
- Implement 'queue_arr_create' function.
- Implement 'queue_arr_enqueue' function.
- Implement 'queue_arr_dequeue' function.
- Implement 'queue_arr_peek' function.
- Implement 'queue_arr_length' function.
- Implement 'queue_arr_create' function.
-
-
Define priority queue data structure.
- Implement 'min_heapify' function.
- Implement 'max_heapify' function.
- Implement 'get_item' function.
- Implement 'insert_item' function.
- Implement 'remove_item' function.
- Implement 'edit_item' function.