How can the following function be implemented in various languages? Calculate the (x,y) point on the circumfe
I am to show that log(n!) = Θ(n·log(n)). A hint was given that I should show the upper bound with nn and sh
Imagine two positive integers A and B. I want to combine these two into a single integer C. There can be no
What is the most efficient way given to raise an integer to the power of another integer in C? // 2^3 pow(2,3
Today I needed a simple algorithm for checking if a number is a power of 2. The algorithm needs to be: Simpl
I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the Tayl
How do I calculate the distance between two points specified by latitude and longitude? For clarification, I&
I had an interesting job interview experience a while back. The question started really easy: Q1: We have a b
What is the best way to represent and solve a maze given an image? Given an JPEG image (as seen above), wha
I've been learning about different algorithms in my spare time recently, and one that I came across which
I recently came across the data structure known as a skip list. It seems to have very similar behavior to a bi
I'm trying to answer two questions in a definitive list: What are the underlying data structures used fo
This is a simple question from algorithms theory. The difference between them is that in one case you count nu
Suppose we have two stacks and no other temporary variable. Is to possible to "construct" a queue data struct
Say you have a linked list structure in Java. It's made up of Nodes: class Node { Node next; //
I feel a bit thick at this point. I've spent days trying to fully wrap my head around suffix tree constru
What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the onl