A community dedicated to topics related to data structures and algorithms.
🌉 bridged from !data_structures@programming.dev by Tidepool
A community dedicated to topics related to data structures and algorithms.
🌉 bridged from !data_structures@programming.dev by Tidepool
What would be the "least boring" sorting algorithm?
I'm currently working on a little web app that allows the user to sort a list of elements (like a tier-list maker).
Instead of just asking the user to sort the list through drag'n drop, I thought I could run a sorting algorithm that would ask the user every time it needs to make a comparison.
The whole thing would feel a bit magic, since you would have several questions like "Which one do you prefer, A or B?" and get your sorted list.
The question is: which algorithm should I use to keep the user entertained? I don't want to compare A with everything, then B with everything and so on with something like a Bubble Sort, that would be boring.
What do you think about it? Please be aware this is not a big project, just something I make out of curiosity. Thanks in advance!
Edit: As an example, let's say I want to sort fruits by personal preference. I have a list [Apple, Banana, Coconut, Durian, Eggplant, Fig, Grape] but no algorithm can tell if I prefer an apple or a banana so it needs to ask me. What would be the questions an algorithm needs to ask me in order to sort the list of fruits for me? The idea behind it is not to sort stuff but to spark discussion during the "comparison" step ("Ok, why do you prefer bananas to apples?"), that's why I need successive comparisons to be different, so it keeps the users' interest.
What are the best resources for learning Data Structures and Algorithms the right way?
I'm currently finishing a CS degree, so I've had some DSA courses. Nonetheless, I don't feel I have good enough theoretical foundations or proficiency when putting them into practice. My main goal would be to prepare myself for coding interviews, but I'd also want to make sure I understand well theory. What are the best resources for learning Data Structures and Algorithms theoretical with good theoretical background that also allows you to succeed in coding interviews? Some resources I've found, but I haven't followed myself:
• Algorithms, Part I by Princeton University (Coursera) taught in Java • 6.006 Introduction to Algorithms / Electrical Engineering and Computer Science (MIT OpenCourseWare) taught in Python • FreeCodeCamp article linking to other resources: Learn Data Structures and Algorithms – Introduction and Learning Resources (FreeCodeCamp) • Learn About Algorithms and Data Structures (FreeCodeCamp) taught in Python
• Cracking the coding interview (Book) by Gayle McDowell • Data Structures and Algorithms Crash Course (LeetCode)