118 questions
-2 votes
1 answer
543 views
Iterative version of the Bron–Kerbosch algorithm with pivoting
I need much a correct pseudocode of Bron–Kerbosch algorithm (it enumerates all maximal cliques in an undirected unweighted graph). I need iterative (non-recursive) solution with a stack. And the ...
0 votes
0 answers
91 views
Trying to understand this non-recursive Heap's Permutation Algorithm
Right now I'm trying to understand why a certain non-recursive implementation of the Heap's Permutation Algorithm works. I implemented some code of this particular version of the algorithm in python, ...
0 votes
1 answer
239 views
Is there a non-recursive solution in Python for the egg breaking problem with 102 floors and 7 eggs?
I am a novice programmer learning Python using the book: "Introduction to Computation and Programming Using Python" by John V Gurrag. I am attempting a finger exercise in Chapter 3: "...
0 votes
1 answer
66 views
How to convert recursive tree search function to nonrecursively?
I'm trying to explore the binary tree. However, I have to implement recursive functions nonrecursively. I've searched several ways to convert recursion to nonrecursive. But it doesn't seem to apply to ...
1 vote
0 answers
73 views
Is this an acceptable implementation of non recursive merge sort
I'm learning to code, I just read the chapter divide and conquer in the introduction to algorithms book. But I don't like the recursive algorithms and is very hard to my undertand it for that reason I ...
0 votes
3 answers
235 views
Writing a non-recursive function as maximum recursion depth has been exceeded
I was wondering if someone could help me rewrite this code as non-recursive so it can compute higher numbers, my current code looks like this: def T(n): if n < 3: return n return T(...
2 votes
1 answer
94 views
convert object structure of n child tree to nested list in python
I made two classes as follow: Node class class Node: def __init__(self,title): self.title = time self.child = [] And implement methods like getTitle, getChild, addChild, isEmpty:...
0 votes
1 answer
55 views
Javascript how to implement n-dimensions to removeOne with non-recursive
input console.log(removeOne([])); console.log(removeOne([1, 3, 1, 2, 1])); console.log(removeOne([1, 4, [1, 5, 1, 2]])); console.log(removeOne([1, 1, [1, 3, [1, 1, 4, 1], 2]])); output [] [ 3, 2 ] [ ...
0 votes
0 answers
768 views
Receiving CTE syntax error with 10.1.48-MariaDB-0ubuntu0.18.04.1
Beginner with MariaDB and trying to understand the syntax. I’m trying to create the simplest example and then build from there. Shouldn’t the following work? with myCTE as (SELECT 1 as MyNum, 'A' ...
0 votes
0 answers
40 views
Describing QuickSort Algoritm
Im having a problem to understand this algorithm, how would you describe it, mostly the while loops. I understand that this i an iterative function, and the use of Hoare partition scheme. But what ...
1 vote
2 answers
884 views
Non-recursive Quicksort
How do i make the bottom function non-recursive, ive tried but by creating new functions which is not the point in this problem. The first function is given and the inplace_quicksort_non_recursive is ...
0 votes
1 answer
184 views
member access within null pointer of type, C programming is Palindrome
I am trying to solve isPalindrome() question on LeetCode using non recurisve solution, When i run this code using VSCode it runs and gives me the right output, but when i run it in LeetCode compiler ...
0 votes
1 answer
187 views
Is async code in a Promise always an antipattern?
I see from this question that it can be an antipattern to mix Promises with async code. Does this, however, apply in all cases? I can't see an easy way to avoid combining them in the following code: ...
0 votes
1 answer
220 views
Convert recursive function to a loop (ternary operator)
so I have this code from an exam question and I have to convert the recursive part with a loop, now I tried many times but the loop will be endless, here what I did: code with recursive int f(int n, ...
0 votes
0 answers
59 views
How can I turn this Recursive program to Dynamic one?
I got below recursive function written in Java. I wanted to convert it to a Dynamic program but I don't know it is right or not? I think I'm missing something here. Any guidance would be perfect. //...