
Newest 'algorithm' Questions - Stack Overflow
Apr 8, 2026 · [algorithm] An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Sign up to watch this tag and see more personalized content 121,489 …
algorithm - recursion versus iteration - Stack Overflow
Mar 28, 2013 · Is it correct to say that everywhere recursion is used a for loop could be used? And if recursion is usually slower what is the technical reason for ever using it over for loop iteration? And if i...
What is the difference between an algorithm and a function?
An algorithm is a series of steps (a process) for performing a calculation, whereas a function is the mathematical relationship between parameters and results. A function in programming is different …
algorithm - What does O (log n) mean exactly? - Stack Overflow
Feb 22, 2010 · A common algorithm with O (log n) time complexity is Binary Search whose recursive relation is T (n/2) + O (1) i.e. at every subsequent level of the tree you divide problem into half and do …
Peterson algorithm in Java? - Stack Overflow
May 26, 2010 · Is there example implementation of Peterson algorithm for mutual exclusion in Java?
Writing an algorithm for scrabble - Stack Overflow
I'm working on a crossword-like problem, but I don't know how to design the algorithm. For example: there are words like 'car', 'apple' in the dictionary. the word 'app' is given on the board. the...
algorithm - What is the difference between depth and height in a tree ...
Dec 1, 2023 · This is a simple question from algorithms theory. The difference between them is that in one case you count number of nodes and in other number of edges on the shortest path between …
Tower of Hanoi: Recursive Algorithm - Stack Overflow
Aug 3, 2009 · Here is the algorithm again with n representing the number of rings, and A, B, C representing the pegs. The first parameter of the function is the number of rings, second parameter …
What is Sliding Window Algorithm? Examples? - Stack Overflow
While solving a geometry problem, I came across an approach called Sliding Window Algorithm. Couldn't really find any study material/details on it. What is the algorithm about?
algorithm - How to find maximum spanning tree? - Stack Overflow
Feb 14, 2011 · Does the opposite of Kruskal's algorithm for minimum spanning tree work for it? I mean, choosing the max weight (edge) every step? Any other idea to find maximum spanning tree?