/SortedList

Efficient sorted list implementation in C using doubly linked lists and customizable element ordering.

Primary LanguageCMIT LicenseMIT

SortedList

This repository contains a C implementation of a sorted list data structure based on doubly linked list implementation provided also in the project. The implementation is organized into include, test, and src folders.

Overview

This repository provides a C data structure implementation of a sorted list. It includes a set of files that make it easy to build, run, test, and clean the project.

Getting Started

Prerequisites

Before you begin, ensure you have the following prerequisites installed on your system:

make: If you don't have make installed, you can download and install it from the official website:

Download from the command line:

Linux:

$ sudo apt install make -y

MacOS:

$ brew install make

gcc Compiler: If you don't have gcc installed, you can download and install it from the official website:

Download from the command line:

Linux:

$ sudo apt update
$ sudo apt install build-essential

MacOS:

$ brew install gcc

Windows:

pacman -Syu
pacman -S mingw-w64-x86_64-gcc
gcc --version

Installation

  1. Clone or Download the Repository: You can clone this Git repository or download it as a ZIP file to your local machine.
$ git clone https://github.com/YamtalDev/SortedList.git
$ cd SortedList/test/sorted_list
  1. Compile and run the Project: Use make to compile the project:
$ make
$ make run

Project structure:

├── SortedList/
│   ├── bin/
│   │   ├── executables/
│   │   ├── objects/
│   │   ├── shared_libs/
│   │   └── static_libs/
│   |
|   ├── include/
│   │   └── Header file
|   |
│   ├── src/
│   │   └── src file
|   |
│   ├── test/
│   │   ├── makefile
│   │   └──test file

Usage

To compile, run, debug, or clean the project, you can use the provided Makefile with the following commands:

  • Simple compilation
$ make
  • Running the project
$ make run
  • Debugging the project
$ make debug
  • Deleting all the .o, executables, shared/static libs files
$ make clean 
  • Checking valgrind on the project
$ make vlg
  • Release compilation with optimization -O3
$ make release

These simple commands streamline the development process and make it easy to work with each project in this repository.

License:

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or issues, feel free to create an issue or contact the project maintainer.

Connect with me:

linkedin logo discord logo slack logo github logo facebook logo medium logo