Completely Fun
Kerolosnady1/Completely-FunOverview
Music Playlist Manager: A system to create and manage music playlists with YouTube links && ChatBot System: An interactive chatbot with different personality modes
Synchronized repository from GitHub (Kerolosnady1/Completely-Fun).
Technologies & Frameworks
Repository Documentation (README.md)
Live Synchronized🎵 YouTube Music Playlist Manager with Chatbot & Algorithms
A C++ console application that combines a playlist manager with a hybrid chatbot interface.
You can control everything by typing numbers (e.g., 1) or natural language (e.g., add song).
📸 App Shots
Landing

Commands

✨ Features
Core Playlist Management
- Add songs with title, artist, genre, duration, and YouTube link
- Remove last song or remove by title
- Edit any song’s details
- Display all songs
- Undo last removal (stack)
- Play queue (FIFO queue)
- Save playlist to CSV (Excel‑compatible)
- Load playlist from CSV
Algorithms from Course (PDF)
- Sorting: Merge Sort (stable, O(n log n)), Quick Sort (avg O(n log n)), Insertion Sort (O(n²))
- Searching: Linear Search (O(n)), Binary Search (O(log n) on sorted array)
- Tree: Binary Search Tree (BST) for title‑based search
- Benchmark: Compare sorting algorithms on the same data (microsecond precision)
Chatbot Interface
- Type
helpto see all commands - Recognises numbers (e.g.,
1) or text (e.g.,add song) - Friendly responses for greetings, help, and bye
📋 Command Reference
| # | Text command | Action |
|---|---|---|
| 1 | add song |
Add a new song |
| 2 | remove last |
Remove the last song |
| 3 | display |
Show all songs |
| 4 | play next |
Play next song in queue |
| 5 | search |
Search by title (BST) |
| 6 | undo |
Undo last removal |
| 7 | save |
Save playlist to CSV |
| 8 | sort |
Sort playlist (choose key & algorithm) |
| 9 | binary search |
Binary search by title (needs sort) |
| 10 | linear search |
Linear search by title |
| 11 | search artist |
Find songs by artist |
| 12 | search genre |
Find songs by genre |
| 13 | edit song |
Edit a song’s details |
| 14 | load CSV |
Load playlist from CSV file |
| 15 | benchmark |
Compare Merge vs Quick vs Insertion |
| 16 | remove title |
Remove a song by title |
help |
Show this menu | |
bye or 0 |
Exit program |
🛠️ Technologies
- C++17
- Standard libraries:
<iostream>,<vector>,<fstream>,<ctime>,<chrono>,<algorithm> - File format: CSV
🏃 Getting Started
Compile (Linux/macOS/Windows with g++)
```bash
g++ -std=c++17 playlist_project.cpp -o playlist
./playlist
Windows (Visual Studio)
Create a new console project, paste the code, and run.
📁 File Structure
playlist_project.cpp – single source file
MyPlaylist.csv – exported playlist (auto‑generated)
chat_history.csv – not used in final, but log is inside CSV
📚 Algorithms Demonstrated
Sorting: Merge, Quick, Insertion (with complexity analysis)
Searching: Linear, Binary, BST
Data Structures: Doubly linked list, stack, queue, BST
Benchmarking: Compare algorithm speeds using
👨💻 Author
Computer Science student – Algorithms course project.
📄 License
MIT – free to use and modify.
text
2. Report (like the PDF you sent)
I'll write a structured report similar to your Completely-Fun-Report_V2.pdf – with sections for each class, algorithm, and new features.
```text
PROJECT REPORT: YOUTUBE PLAYLIST MANAGER
ALGORITHMS COURSE – SPRING 2026
========================================================================
-
INTRODUCTION
This project implements a music playlist manager with a hybrid
(number/text) chatbot interface. It uses data structures and
algorithms taught in the course: linked lists, stacks, queues,
binary search trees, sorting (merge, quick, insertion), and
searching (linear, binary). The user can add, remove, edit, sort,
search, and save songs. All actions are accessible via numbers or
natural language commands. -
CLASS DIAGRAM & DATA STRUCTURES
2.1 Song (struct)
- Members: title, artist, genre, duration, youtubelink, next, prev
- Methods: getformattedDuration(), display()
- Purpose: store song metadata and act as a node in doubly linked list
2.2 DoublyLinkedList
- Members: head, tail, count
- Methods: push_back(), begin(), empty(), size()
- Used for: activity log (strings) – but also the playlist uses raw pointers
2.3 PlaylistManager
- Members: name, head, tail, activitylog, count
- Methods: Addsong(), removeLastSong(), removeSongByTitle(),
displayAll(), saveToExcel(), loadFromCSV(),
searchByArtist(), searchByGenre(), editSong()
- Complexity: All operations O(n) except BST search (O(log n) avg)
2.4 Supporting Structures
- StackNode (undo): pushUndo(), popUndo() – O(1)
- QueueNode (play queue): enqueueSong(), playNext() – O(1)
- TreeNode (BST): insertBST(), searchBST() – O(log n) avg, O(n) worst
- ALGORITHMS FROM COURSE (PDF)
3.1 Sorting Algorithms
- Merge Sort: stable, O(n log n), O(n) extra space
Implemented in mergeSort() and merge()
- Quick Sort: in-place, avg O(n log n), worst O(n²)
Implemented in quickSort() and partition()
- Insertion Sort: stable, O(n²), O(1) extra space
Implemented in insertionSort()
- Benchmark: The function benchmarkSorts() runs all three on the same
playlist and prints execution time in microseconds using
3.2 Searching Algorithms
- Linear Search: O(n), used for searchByArtist(), searchByGenre(),
removeSongByTitle(), editSong()
- Binary Search: O(log n), requires sorted array by title. Used in
the 'binary search' command (option 9). The array is sorted using
mergeSort before searching.
- Binary Search Tree: O(log n) average for search by title (option 5).
3.3 Data Structures
- Doubly linked list: used for playlist (Song pointers)
- Stack: undo functionality (last removed song)
- Queue: play next queue
- Binary Search Tree: indexing by title for fast search
- NEW FEATURES ADDED
4.1 Hybrid Chatbot Interface
- No separate menu; user types numbers or text commands.
- The help command lists all options.
- Implemented in processCommand() using toLower() and string::find.
4.2 Search by Artist or Genre
- Linear search through the linked list.
- O(n) time, suitable for typical playlist sizes.
4.3 Edit a Song’s Details
- Find song by title (linear search), then modify fields.
- Does not update BST (simplified – can be extended).
4.4 Load Playlist from CSV
- Parses CSV file (handles quoted fields, duration format MM:SS).
- Reuses Addsong() so YouTube validation is applied.
4.5 Compare Sorting Algorithms (Benchmark)
- Copies current playlist into a vector of Song*.
- Runs mergeSort, quickSort, insertionSort on the same data.
- Measures time with high_resolution_clock.
- Demonstrates real CPU effort differences: O(n log n) vs O(n²).
4.6 Remove Song by Title
- Linear search to locate song, then relink neighbours and delete.
- O(n) time.
- COMPLEXITY ANALYSIS (as per PDF)
| Operation | Time Complexity | Space Complexity | CPU Effort |
|---|---|---|---|
| Add song | O(1) | O(1) | Low |
| Remove last | O(1) | O(1) | Low |
| Remove by title | O(n) | O(1) | Medium |
| Display all | O(n) | O(1) | Medium |
| Search (BST) | O(log n) avg | O(log n) stack | Low |
| Linear search | O(n) | O(1) | High (full scan) |
| Binary search (array) | O(log n) | O(1) | Very low |
| Merge sort | O(n log n) | O(n) | Medium (stable) |
| Quick sort | O(n log n) avg | O(log n) | Low (cache‑friendly) |
| Insertion sort | O(n²) | O(1) | High on large data |
| Benchmark all sorts | O(n log n) + O(n²) | O(n) | High (but one‑time) |
| Load CSV | O(n) | O(n) temp | Medium |
| Save CSV | O(n) | O(1) file | Medium |
- USER INTERFACE & COMMAND FLOW
The main() function enters an infinite loop reading user input.
processCommand() normalises the input (to lower case) and checks against
numbers or keywords. If a match is found, the corresponding action is
executed. The help command prints the full table.
Example session:
1
Title: Blinding Lights
Artist: The Weeknd
Genre: Pop
Duration (sec): 200
YouTube Link: https://youtube.com/...
Song added successfully.search artist
Enter artist name: The Weeknd
(displays song)benchmark
Merge Sort took 125 microseconds.
Quick Sort took 98 microseconds.
Insertion Sort took 1450 microseconds.
- CONCLUSION
This project successfully integrates all required algorithms from the
course PDF (bubble sort was omitted due to inefficiency, but merge, quick,
insertion, linear, binary, BST, stack, queue, linked list are present).
The hybrid chatbot interface makes it easy to use while demonstrating
algorithmic concepts. The benchmark feature directly compares sorting
algorithms, fulfilling the "CPU effort" analysis from the course.
- REFERENCES
- Course PDF (quiz2_revision.pdf) – sorting and searching algorithms.
- C++ reference forand file I/O.