Question Detail: We mostly write programme in high level language. So while studying I came across assembly language. So an assembler converts assembly language to machine language and a compiler does the same with high level language. I found assembly language Read More …
Author: ignougroup
Longest path in an undirected tree with only one traversal
Question Detail: There is this standard algorithm for finding longest path in undirected trees using two depth-first searches: Start DFS from a random vertex $v$ and find the farthest vertex from it; say it is $v’$. Now start a DFS from Read More …
What is tail recursion?
Question Detail: I know the general concept of recursion. I came across the concept of tail recursion while studying the quicksort algorithm. In this video of quick sort algorithm from MIT at 18:30 seconds the professor says that this is a Read More …
How to show that a “reversed” regular language is regular
Question Detail: I’m stuck on the following question: “Regular languages are precisely those accepted by finite automata. Given this fact, show that if the language $L$ is accepted by some finite automaton, then $L^{R}$ is also accepted by some finite; $L^{R}$ Read More …
The math behind converting from any base to any base without going through base 10?
Question Detail: I’ve been looking into the math behind converting from any base to any base. This is more about confirming my results than anything. I found what seems to be my answer on mathforum.org but I’m still not sure if Read More …
What is the difference between storage media and storage devices
Question Detail: I am having confusion whether storage media and storage devices are the same terms. I found on this yahoo answers page that there is a subtle difference but very tricky to understand. I have googled a lot but cannot Read More …
How to verify number with Bob without Eve knowing?
Question Detail: You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write the question on a card which and give it to Eve who will take the card to Read More …
What is most efficient for GCD?
Question Detail: I know that Euclid’s algorithm is the best algorithm for get the GCD (great common divisor) for a list the positive integer numbers. But, in the practice, you can write two codes por evaluate the gcd (for my case, Read More …
Complexity of recursive Fibonacci algorithm
Question Detail: Using the following recursive Fibonacci algorithm: def fib(n): if n==0: return 0 elif n==1 return 1 return (fib(n-1)+fib(n-2)) If I input the number 5 to find fib(5), I know this will output 5 but how do I examine the Read More …
Why are there so many programming languages?
Question Detail: I’m pretty fluent in C/C++, and can make my way around the various scripting languages (awk/sed/perl). I’ve started using python a lot more because it combines some of the nifty aspects of C++ with the scripting capabilities of awk/sed/perl. Read More …