About 6,690 results
Open links in new tab
  1. Iteration vs. recursion: what do these terms really mean?

    Sep 14, 2017 · One can remove any recursion using an explicitly programmed "call stack", as you say, but it's hardly iterative and non-recursive now. Apart from the extreme cases (explicit recursion vs …

  2. Iterative and/or tail-recursive implementations of merge sort?

    3 I recently learned how to implement merge-sort, using a standard recursive algorithm. Can the algorithm be implemented in a way that allows for a tail-recursive implementation? Can it be …

  3. How does DNS work if there is no recursive querying?

    The computer first asks a local domain name server (DNS) what the IP address of this website is. If it can't find it, it then asks the root server, etc. This is recursive querying. How does DNS work if there …

  4. Performance of Recursive vs Iterative Solution to "Maximum Depth of a ...

    Mar 10, 2020 · There are two solutions to this question - the recursive solution and the iterative / breadth-first traversal solution. My question is in regards to the memory requirements of each …

  5. Induction to prove equivalence of a recursive and iterative algorithm ...

    Using induction how do you prove that two algorithm implementations, one recursive and the other iterative, of the Towers of Hanoi perform identical move operations? The implementations are as foll...

  6. Technique for converting recursive DP to iterative DP

    Nov 26, 2020 · The title is misleading in the sense that dynamic programming can use either recursive method or iterative method. The correct title should be "How to convert DP using recursive method to …

  7. BFS vs DFS, and Timing of Marking Vertex as Visited

    Nov 12, 2019 · Thus, a node's neighbours are visited in depth-first manner vs one-after-another. In the recursive implementation, one may choose to mark the neighbours as visited before calling dfs () for …

  8. algorithms - How to solve Tower of Hanoi iteratively? - Computer ...

    Aug 26, 2018 · Since there is a unique minimal solution, the iterative solution must be the same as the usual recursive solution. You should be able to prove this by induction.

  9. Differences between DFS based cycle detection algorithms

    It seems to me that the difference between grey nodes as in 2. and stack nodes is that grey nodes are "recursive stack" nodes (i.e. nodes in the stack of the recursive calls if DFS is implemented recursively)

  10. graphs - DFS (Depth-first search) vs BFS (Breadth-first search) Space ...

    Apr 16, 2024 · 2 Problem I am currently digging deep into some optimizations on the classical iterative approaches to both DFS and BFS algorithms. The material I'm currently using at my University …