My submission for the second assignment of the Data Structures course.
# Clone the repository
git clone https://github.com/spigelli/Data-Structures-Assignment-1
# Change to the project directory
cd Data-Structures-Assignment-2
# Compile and run the program
make && ./main
# Clean up the project directory after running
make cleanThis repo simply indicates the implimentation of a Singly Linked List and a Stack using a Vector.
Check the main.cpp file for the unit tests and implementation details.
Objective: Build a Single_Linked_List class.
Requirements: Your class should have the data members:
headtailnum_items
Write the following member functions, which perform the same operations as the corresponding functions in the standard list class:
push_frontpush_backpop_frontpop_backfront,backemptyvoid insert(size_t index, const Item_Type& item): Insert item at position index (starting at 0). Insert at the end if index is beyond the end of the list.bool remove(size_t index): Remove the item at position index. Return true if successful; return false if index is beyond the end of the list.size_t find(const Item_Type& item): Return the position of the first occurrence of item if it is found. Return the size of the list if it is not found.
Objective: Write a C++ program to implement a stack of integers using a vector with push and pop operations.
Perform the following operations:
- Create a stack object.
- Check the stack is empty or not.
- Insert some integer values onto the stack.
- Remove an element from the stack.
- Find the Top of the stack.
- Find average value of the stack elements.
- You should have a header file and .cpp file. The header file should provide the function declaration and .cpp file should have implementation details.
- All the functionality of the program should be implemented as functions and methods.
- The code should be well commented.
- Create a report (readme file) that contains instruction on how to run the code and screen shots of the outputs.
- Upload your report and code files to GitHub.
- Submit the GitHub link on Canvas by the due date.
