Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Task Scheduler

Overview

This project is used to let you queue, process, undo, and inspect tasks in real time.
Under the hood it showcases classic data‑structure interplay:

Structure Role File
Queue (FIFO) Holds pending tasks, sorted by arrival order queue.c / queue.h
Stack (LIFO) Holds completed tasks so the last one can be undone instantly stack.c / stack.h

The program’s modular design (separate headers for the scheduler core, queue, stack, and utility helpers) makes it easy to extend—e.g., add persistence, deadlines, or different scheduling policies.

Key Features

Menu # Action What Happens
1 Add a Task Collects a task name + priority (1‑5). Rejects empty or duplicate names.
2 Process a Task Dequeues the next pending job, echoes it, then pushes it onto the completed stack.
3 Undo Last Completed Pops the stack and re‑queues the item so it becomes pending again.
4 View Pending Pretty prints the queue with running numbers and priorities.
5 View Completed Shows the stack (top → bottom) so you can track all finished work.
6 Exit Frees every dynamically allocated node in both structures before terminating.

Why You Might Like the Code

  • Pure C11 – no third‑party libraries, ready for GCC, Clang, or MSVC.
  • Safety First – every malloc checked, every fgets trimmed, priorities ranged 1‑5.
  • Undo Without Drama – the stack/queue combo demonstrates clear separation of concerns.
  • Teaching‐Ready – perfect for labs on linked lists, stacks, queues, or menu‑driven UIs.

Building & Running

Windows User:

  1. Download VS Code and C/C++ Extension in VS Code.
  2. Download MinGW. Link: https://sourceforge.net/projects/mingw/
  3. In Terminal, type gcc Book_Catalog.c -o Book_Catalog.exe for compile the program and build the executable.
  4. In Terminal, type .\Book_Catalog.exe to run the program.

Mac User:

  1. Open Terminal, type xcode-select --install to install the Command Line Tools.
  2. In Terminal, type gcc Book_Catalog.c -o Book_Catalog for compile the prgram and build the executable.
  3. Lastly, type ./Book_Catalog to run the program.

Feel free to fork and add advanced scheduling algorithms or persistence.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages