Breadth First Vs Depth First
When Traversing a Tree/Graph what is the difference between Breadth First and Depth first? Any coding or pseudocode examples would be great. 4 Answers 4
When Traversing a Tree/Graph what is the difference between Breadth First and Depth first? Any coding or pseudocode examples would be great. 4 Answers 4
What is the difference between a heap and BST? When to use a heap and when to use a BST? If you want to get the elements in a sorted fashion, is BST better over heap? 8 Answers 8
This is a long text. Please bear with me. Boiled down, the question is: Is there a workable in-place radix sort algorithm? Preliminary I’ve got a huge number of small fixed-length strings that only use the letters “A”, “C”, “G” and “T” (yes, you’ve guessed it: DNA) that I want to sort. At the moment, … Read more
Many sites offer some statistics like “The hottest topics in the last 24h”. For example, Topix.com shows this in its section “News Trends”. There, you can see the topics which have the fastest growing number of mentions. I want to compute such a “buzz” for a topic, too. How could I do this? The algorithm … Read more
I have an n x m matrix consisting of non-negative integers. For example: 2 3 4 7 1 1 5 2 6 2 4 3 4 2 1 2 1 2 4 1 3 1 3 4 1 2 1 4 3 2 6 9 1 6 4 “Dropping a bomb” decreases by one the … Read more
I want to design a program that can help me assess between 5 pre-defined colors which one is more similar to a variable color, and with what percentage. The thing is that I don’t know how to do that manually step by step. So it is even more difficult to think of a program. More … Read more
I’m solving a problem and it involves sorting 10 numbers (int32) very quickly. My application needs to sort 10 numbers millions of times as fast as possible. I’m sampling a data set of billions of elements and every time I need to pick 10 numbers out of it (simplified) and sort them (and make conclusions … Read more
I have a line from A to B and a circle positioned at C with the radius R. What is a good algorithm to use to check whether the line intersects the circle? And at what coordinate along the circles edge it occurred? 29 Answers 29
How can I find (iterate over) ALL the cycles in a directed graph from/to a given node? For example, I want something like this: A->B->A A->B->C->A but not: B->C->B 17 Answers 17
I am looking for an algorithm to convert between HSL color to RGB. It seems to me that HSL is not very widely used so I am not having much luck searching for a converter. 22 Answers 22