I have a php recursive function as shown in the below: function displayDropdown(&$catList, $parent, $current=[], $level=0) { if ($parent==0) { foreac
I got stuck with my binary search method and I don't really know what I'm doing. At this moment I got 1 Error (CS0161) not all code paths return a value int l
I am trying to understand the recursive call within the binary function is_bst. The goal of the function is to check if a tree is a binary search tree or not. N
I am practising recursion and am not sure why my code is failing. def isEqual(arr, n): if(n==1): return arr[n] return arr[n-1]==isEqual(arr, n-1
I have a scenario, where I am using the State pattern. Every Start has an Action defined. We start with an initial state and an initial Action and then keep goi
I'm currently learning as much as I can about recursion but I'm really stuck on how to use it to check whether all the number elements in an array are even numb
I need to convert a Tree with the following class structure: Class Tree: def __init__(self, data): self.data = data s
Language: Scala I'm working on some tail recursion questions in Scala. (GOAL) A function that counts the number of ones in a list. The function takes a list of
I need to flatten an arbitrarily nested list to a data frame and retain the path of keys / indices in one column, while extracting each element on the bottom le
I have an assignment in recursion. The problem: A game board is defined by a list. Each list index, (0: n-1) is a row in the board, and the int value in each li
I tried to find all the .xvg files generated by Gromacs inside a directory as well as its subdirectories and then copy them to a new directory, with new names f
I wrote a function to find a file in a specific directory and its sub-directories. You can input the filename with or without extension (basename vs. filename).
I have created a function wrapper to help give me various print statements: function fnWrapper(fn, verbosity=false) { return function(...rest) {
I really don't know how to properly describe my problem. I have an assignment to do and as part of that I need to take a list and return a new list that is an a
I am learning the basics of CPP programming. I came across this basic recursion question which I'm unable to understand. The output is 1 2 3 4 5 but I don't und
I have the following recursive function to count the number of ways change can be returned given various coin denominations: function makeChange(amount, coi
I have the following recursive function to count the number of ways change can be returned given various coin denominations: function makeChange(amount, coi
*** UPDATED object structure *** I'd like to update recursively the property values of mainObject from the properties that exist in updatingObject. let mainObje
I got a partition problem for which I need advice. I'm given a 1D array whose length is even. I need to write a boolean method to determine whether the array ca
I would like to be able to recursively find all relationships in a table. I have a relational table, and essentially I would like to apply the transitive proper