Skip to content

therealdaud/cpp-doubly-linked-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Doubly Linked List

This project implements a doubly linked list of integers in C++.
It supports insertion, deletion, searching, and string conversion, while maintaining elements in sorted order.


✨ Features

  • Insert at head and tail
  • Insert in sorted order
  • Delete from head and tail
  • Delete a specific node
  • Search for a value
  • Convert list to a string
  • Print all elements
  • Proper memory management (constructor & destructor)

🧪 Testing

The project uses the Catch2 testing framework to verify functionality.

Example tests:

  • Insert elements and check order
  • Delete head, tail, and specific nodes
  • Validate string representation of the list

📂 Project Structure

├── intDList.hpp # Header file for doubly linked list class

├── intDList.cpp # Implementation of the list

├── intDList_test.cpp # Unit tests using Catch2

├── IntDList_node.hpp # Node class definition

├── catch.hpp # Catch2 single-header test framework


🚀 How to Run

Compile and run tests

g++ -std=c++11 intDList.cpp intDList_test.cpp -o test
./test

🖥️ Sample output

All tests passed (5 assertions in 1 test case)


🎯 Learning Outcomes

  • Gained hands-on experience with pointers and dynamic memory management in C++
  • Practiced data structures implementation (doubly linked list)
  • Applied unit testing using Catch2
  • Organized project with headers, implementations, and tests

📜 Authors

Daud Ahmad Nisar

Computer Science Student at the University of South Florida

daudnisar1@gmail.com

About

A data structures project that implemented a doubly linked list in C++ from scratch with head/tail pointers, insertion, deletion, search, and maintaining sorted order. It also used the Catch2 testing framework to write test cases that validate the code’s correctness

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages