This project implements a complete temperature data processing system in C, which allows the user to load and manage daily temperature measurements from a file using one of two data structures:
- Binary Search Tree (BST)
- Hash Table with Chaining
The application reads from a file (temp.txt) where each line represents a day's temperature readings in the format:
{"timestamp1": "value1", "timestamp2": "value2", ..., "timestampN": "valueN"}
- On launch, the user selects one of the following storage modes:
- BST by Date
- BST by Average Temperature
- Hash Table with Chaining
- In-order traversal display with headers
- Search for average temperature by date
- Modify the average temperature of a given date
- Delete a date's entry
- Min/Max temperature search (when sorted by temperature)
- Search for average temperature by date
- Modify average temperature for a given date
- Delete a record by date
- Exit program
- Hash function: Based on the ASCII sum of the date string modulo
m(odd number of buckets)- Example:
Hash("2014-02-13") = (ASCII sum) % 11
- Example:
- Language: C
- Data Structures: Binary Search Tree, Hash Table with Chaining
- File Parsing: Custom logic for JSON-like line parsing
- Memory: Dynamic memory allocation
temp.txt: Input file with daily timestamp-temperature datatemperature_data_manager.c: Main application source file
gcc temperature_data_manager.c -o temp_manager
./temp_manager