Skip to content

Jayeshd6/cpp-assignment1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

cpp-assignment1

Assignment 1 - Implement a Singly Linked List and a Circular Queue

Design two separate classes in C++:

  1. Singly Linked List

● Support insertion at the front, insertion at the end, deletion of a given value, search for a value, and printing all elements.
● Write a main function that demonstrates all supported operations on the linked list.


  1. Circular Queue Using Array

● Create a CircularQueue class using a fixed-size array and two pointers (front and rear).
● Implement enqueue, dequeue, isEmpty, isFull, and printQueue methods.
● Write a main function that demonstrates enqueuing, dequeuing, and edge case handling (overflow/underflow) for the circular queue.


Requirements:

● Use clear class structures and separate implementations for each data structure.
● Do not use standard library containers like std::list or std::queue for the main logic—you must create the underlying structure yourself.
● Well-commented code and basic error handling are expected.


Extension (Optional for Bonus):

● Implement a function to reverse the entire linked list in place.
● Add a peek function to your circular queue that returns the value at the front without removing it.

About

Assignment 1 - Implement a Singly Linked List and a Circular Queue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages