ravi115/Data-Structure-and-Algorithm — reverse-engineered prompt

Reverse engineered prompt

Build me a simple Java project that feels like a clean practice library for the algorithms described here. I want runnable examples for binary search and its common variations, like normal binary search, checking ascending or descending order, finding first and last occurrence, searching in a rotated sorted array, searching in a nearly sorted array, counting occurrences, and finding the floor of a number. I also want the sorting examples included, bubble sort, selection sort, insertion sort, and count sort.

Please make it easy for someone learning this stuff to run and understand. Add clear comments, small sample inputs and outputs, and a basic console menu or demo runner so I can try each algorithm without editing code every time. If the current code is messy or incomplete, clean it up and organize it in a sensible way. Include simple correctness checks or tests if you can.

Keep it beginner friendly and practical. Look up current Java docs online if you need to.

Want more depth? Deep Reverse