Skip to content

DennisKapelles/Temperature-data-structures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Temperature Data Manager (C)

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"}

๐Ÿ“ฆ Features

๐Ÿ”ธ Mode Selection

  • On launch, the user selects one of the following storage modes:
    • BST by Date
    • BST by Average Temperature
    • Hash Table with Chaining

๐Ÿ”น BST Functionality (Sorted by Date or Avg Temp)

  1. In-order traversal display with headers
  2. Search for average temperature by date
  3. Modify the average temperature of a given date
  4. Delete a date's entry
  5. Min/Max temperature search (when sorted by temperature)

๐Ÿ”น Hash Table Functionality

  1. Search for average temperature by date
  2. Modify average temperature for a given date
  3. Delete a record by date
  4. 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

๐Ÿ”ง Technologies Used

  • Language: C
  • Data Structures: Binary Search Tree, Hash Table with Chaining
  • File Parsing: Custom logic for JSON-like line parsing
  • Memory: Dynamic memory allocation

๐Ÿ“‚ File Structure

  • temp.txt: Input file with daily timestamp-temperature data
  • temperature_data_manager.c: Main application source file

โ–ถ๏ธ Compilation & Execution

gcc temperature_data_manager.c -o temp_manager

./temp_manager

About

A C application for managing temperature measurements using Binary Search Trees and Hash Tables with chaining. Supports file parsing, search, update, and deletion operations by date or average temperature.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages