Member Avatar
Hi every one, I had implemented Karatsuba algorithm in C++, but I have been stuck for 2 days. First problem is the function give incorrect answer, second problem is it oftens crash when run (runtime error). I try to debug but cannot understand how it's not work. I hope someone …
by Gà_1 in Computer Science ()
Member Avatar
Hello, I've been working at this code from a couple angles, I've had two people I've known to help me, but even with their help it hasn't worked. The question I have relates to CodeLab: Write the definition of a function named printStarBucks that receives a non-negative integer n and …
by theoryforlife in Software Development ()
Member Avatar
When recursion won't do, then memoizaton will.
by BustACode 15 in Software Development ()
Member Avatar
Hello ! I have a task that is difficult for me to handle. The task is: Create recursive function that can be generate a string of length N (N <= 100), formed by the letters 'A', 'B' and 'C' and does not containing two identical adjacent substring. For example: enter …
by preslav_milev in Software Development ()
Member Avatar
One of the more common functions in any language is conversion of an integer to a string. This implementation, which demonstrates not only the common function activation record format but also a simple recursive function, was written in response to a recent question in which the OP posted an incomplete …
by Schol-R-LEA 1,003 in Software Development ()
Member Avatar
Hi all, I was just playing around with some ideas about optimizing a core piece of my library: the run-time type identification system (RTTI). What does that have to do with compile-time string concatenation? Well, the whole point of the RTTI is to provide information on the type of objects, …
by mike_2000_17 2,669 in Software Development ()
Member Avatar
Hi guys, I wrote the following code: For some unknown reasonable reason, I get an error for the static method call although I ran it through another one... Please help me make it complie as well... Thank you all !!
by Adami -3 in Software Development ()
Member Avatar
I of generating spiral of numbers and realized I could reuse I posted earlier.
by pyTony 888 in Software Development ()
Member Avatar
Hi, I am making program that finds solution how to put 12 knights(horses) to chess board that every square is dominated or engaged by other knight. Look at my code: I don't get the right output because there are some not dominated squares left. Maybe you can spot my mistake?
by ubhart in Software Development ()
Member Avatar
Hi I have to write program that finds a solution how to put 12 knights to a 8x8 chess board that every square would be dominated by one of the 12 knights. Do you have any suggestions from where I can start?
by ubhart in Software Development ()
Member Avatar
How's the result to this 7?
by Pyler in Software Development ()
Member Avatar
i have a c code for printing all permutation of string. I have a problem in understanding ,how recursion work in for loop and how backtracking is used in this code. Another question is that how stack work in recursion under for loop. my code-->
by vibhu mishra in Software Development ()
Member Avatar
def isPrime(num,div=2): if(num==div): return True elif(num % div == 0): return False else: return isPrime(num,div+1)
by birinci2012 in Software Development ()
Member Avatar
In most modern languages, there are two fundamental approaches to repeating an action: either iteration, in which an action is placed inside a special-purpose structure which causes the action to be repeated, or recursion, in which a general-purpose function calls itself (or another function which in turn calls the earlier …
by Schol-R-LEA 1,003 in Software Development ()
Member Avatar
Following up on a discussion on , I did some tests on the performance of recursion vs. iteration, and some interesting things happened, so I thought I would share the results. I'm gonna structure this a bit like a lab-report, because that's really the best way to put it. But …
by mike_2000_17 2,669 in Software Development ()
Member Avatar
Hey everyone, I really need help in solving a problem that I have to use recursion for. I have a list of paper objects. Each paper object has its own author(s) objects. Each author object knows which paper(s) objects they belong to. I have to build a scholarly neighborhood for …
by CheerfulBiscuit in Software Development ()
Member Avatar
This is just a piece of code I've found over the Internet, and I'm trying to understand why the output is 3 1 1 2 1 1 2 3. Could anyone explain using a stack representation or something else, I am really stuck on this one. I did read about …
by jackslv in Software Development ()
Member Avatar
I am having trouble understanding why f(5) = 16 when I run the program. i = 5 // 2(4) = 8 i = 4 // 2(3) = 6 i = 3 // 2(2) = 4 i = 2 // 1 these don't add to 16. I would really appreciate some …
by kruschev in Software Development ()
Member Avatar
Hi. I was wondering how I could replace objects in a list without using a single loop. Here's what I have in terms of algorithm; but, I don't know how to implement.: replace(List list, oldObject, newObject) Ps. I know the == is not allowed when comparing objects, its just pseduo …
by woomar in Software Development ()
Member Avatar
Hey guys I had an assignment to recursively write the Towers of Hanoi then test it. I did not have too much of an issue getting the program written But I am not sure what the book means by test the efficiency do they want the number of moves my …
by MrHardRock in Software Development ()
Member Avatar
Im trying to add Total function and isMono functions to this code. Did total already Need help with function ismono which returns whether a tree is mono (all the elements are unique aka no element appears more than one time) or not. Please this is the original program
by harde_1 in Software Development ()
Member Avatar
Hello, First of all some background. My friend and I are having a bit of a competition over theoretically infinite number storage. We have agreed that the first person with a working arbitrary precision integer library with the theoretical ability to store an infinitely large number (IE: if the hard …
by Labdabeta 182 in Software Development ()
Member Avatar
Hello all, I'm having trouble writing a spell checker as my recursive function isn't returning what I would like it to. It is meant to chop off the ends of words likes "baker" to bake and check against a predined dictionary. I used recursion for words like "baker's". I have …
by fatalaccidents in Software Development ()
Member Avatar
Hello all, I am trying to get a bunch of sub-keys and values from the registry in vb 2010 and i remember in vb6 this was quite easy. Can anyone share code to help? Or a link where I can go? I've been searching for nearly 8 hours on line …
by amvx86 in Software Development ()
Member Avatar
i am trying to use recursion to find the occurence of a specific character in an array of characters any help or suggestions would be appreciated.. thanks
by newGains in Software Development ()
Member Avatar
Hi everyone I am having trouble finding the nth node of a binary search tree in an inorder traversal. I am getting NullPointerExceptions for any numbers other than 2 and 3 and even those print out the wrong values. If anyone could help it would be greatly appreciated. The method …
by tingwong in Software Development ()
Member Avatar
Hi I'm working on the implementation of a boolean method to check if an expression has balanced parentheses using recursion. I cant figure out how to check if two elements of a given expression match i.e ( ). I was able to finish it without a problem using stacks, but …
by hous3aholik in Software Development ()
Member Avatar
Hi again, I have the simple code below, and I receive the error "best overloaded method match has some invalid arguments". I tried to return a string or an int and then it said that I can't implicitly convert void to string. Any ideas on how I can overcome it? …
by cerealBoxx in Software Development ()
Member Avatar
Hi guys, I have this code - I am trying to find if a number is present in a given array using recursion. The thing is, I get the error "not all code paths return a value". I don't know how to fix this. Please advise.
by cerealBoxx in Software Development ()
Member Avatar
this code gives the correct result upto size 6 (i'v run this a few times, and 6 seems to be the boundary), although the intermediate steps are all insane! then onwards, from size 7, it returns minimum value 0 i cant understand why this is so... :( any help regarding …
by somjit{} 28 in Software Development ()