https://github.com/pjsalter/library-catalog-optimisation
Library Catalog Optimisation: A C++ project for managing a sorted list of books using linked lists and vectors, optimising book insertions with operation tracking.
https://github.com/pjsalter/library-catalog-optimisation
cpp cpp23 linked-list object-oriented-programming vector
Last synced: 7 months ago
JSON representation
Library Catalog Optimisation: A C++ project for managing a sorted list of books using linked lists and vectors, optimising book insertions with operation tracking.
- Host: GitHub
- URL: https://github.com/pjsalter/library-catalog-optimisation
- Owner: PJSalter
- Created: 2023-10-30T21:58:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T22:43:24.000Z (over 2 years ago)
- Last Synced: 2025-01-03T11:21:53.540Z (over 1 year ago)
- Topics: cpp, cpp23, linked-list, object-oriented-programming, vector
- Language: C++
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📚 Library Catalog Optimization
### 📖 A Library Book Sorting Application
## Overview
This C++ project 📊 manages a sorted list of books implemented using a linked list (LinkedListLibrary) and the same list implemented using a vector (VectorLibrary). Each list contains 100 books, sorted in ascending order by ISBN number. 📖📚 The primary goal is to insert a new book into both the linked list and the vector and output the number of operations required for each insertion. 🚀
## Project Structure
The project includes the following key components:
- `main.cpp`: The 🏗️ main program that orchestrates the book insertion process and reports the number of operations for both the linked list and vector. 📦
- `LinkedListLibrary.h` and `LinkedListLibrary.cpp`: The linked list implementation, including insertion and destruction methods. 📦
- `VectorLibrary.h` and `VectorLibrary.cpp`: The vector implementation, including insertion and printing methods. 📈
- `BookNode.h` and `BookNode.cpp`: A class representing individual book nodes used in the linked list. 📖
- `Book.h` and `Book.cpp`: A class representing books with attributes such as title, author, and ISBN. 📕
## How to Compile and Run
To compile and run the project, follow these steps:
1. Ensure you have a C++ development environment set up, such as a C++ compiler (e.g., g++). 🛠️
2. Clone or download this repository to your local machine. 📦
3. Open a terminal or command prompt and navigate to the project directory. 🖥️
4. Compile the C++ code:
```bash
g++ LinkedListLibrary.cpp VectorLibrary.cpp BookNode.cpp Book.cpp main.cpp -o BookSortingApp
```
5. Run the executable: 🚀
```bash
./BookSortingApp
```
6. Observe the output, which will display the number of operations required to insert a new book into both the linked list and the vector. 📊
## Example Input
```
The Catcher in the Rye
9787543321724
J.D. Salinger
```
## Example Output
```
Number of linked list operations: 1
Number of vector operations: 1
```
## Conclusion
This C++ Application provides a simple comparison of insertion operations between a linked list and a vector data structure. It offers a basic illustration of how different data structures can impact the efficiency of operations like insertion. 🧐