Skip to content

iremnaz-d/MultiLevelIndexing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Level Indexing and Sorting System

This project is a C-based database indexing simulator developed as part of the Computer Engineering curriculum at Dokuz Eylül University. It demonstrates advanced file organization, memory management, and sorting algorithms by simulating a multi-level relational structure (Country $\rightarrow$ City $\rightarrow$ Product).

🚀 Features

  • Multi-Level Indexing: Implements an array-based Singly Linked List architecture to map hierarchical data without traditional pointer nodes, optimizing memory lookup.
  • Binary File Management: Direct disk access using fseek, fread, and fwrite on a Binary.dat file. Only offsets are stored in RAM, significantly reducing memory footprint during searches.
  • Replacement Selection Sort (RSS): Generates initial sorted runs using a min-heap structure, dynamically handling incoming data streams. Includes step-by-step console visualization.
  • Natural Merge Sort: Efficiently combines the runs generated by the RSS algorithm into a fully sorted dataset.
  • Zero Memory Leaks: Strict dynamic memory management (malloc / free) ensuring system stability during execution and upon exit.

🛠️ Technical Stack

  • Language: C
  • Concepts: File Structures, Min-Heap, Array-Based Linked Lists, Ternary Search Trees / Indexing, Memory Allocation.

⚙️ How It Works

  1. The system reads initial unsorted data and allocates necessary memory arrays.
  2. It builds the primary indices (countries, city_index, product_index).
  3. Users can interact with the data via a CLI menu (Insert, Search, Visualize Sort).
  4. For product searches, the system queries the RAM-based index to find the exact byte offset, then jumps to that location in the .dat file to retrieve the complete record in $O(1)$ disk access time.
  5. All newly inserted data is appended to the .dat file in binary append mode (ab), updating the indices in real-time.

About

A C-based multi-level database indexing simulator implementing Replacement Selection Sort, Natural Merge Sort, and direct binary file management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages