I have a graph, generated by a function, and it zooms itself in and out automatically, depending on the value of the function. I already have the graphing tools and I can display any x,y,width,height at high resolution.
I tried just snapping to the right spot:
x = target_x
y = target_y
width = target_width
height = target_height
But...
Possible Duplicate:
How do you find a roman numeral equivalent of an integer
I am looking for a simple algorithm (preferably in Python). How to translate a given integer number to a Roman number?
string Roman(int Num){...}
For example, Roman(1981) must produce "MCMLXXXI".
...
This is javascript
var result = "2" + 5 + 5;
what would the value of result be? im guessing the 2 isnt taken into consideration?
would it be 210?
Thanks
...
I'm looking for an algorithm, and I have no idea where to start!
I'm trying to get from point A to point B in a cartesian graph. Movement is restricted to that of a RC car: backward, forward, forward-left, and forward-right (constant turning radius; car is either turning completely, or it is not turning at all).
How would I construct ...
This post is really helpful:
http://stackoverflow.com/questions/1095650/how-can-i-efficiently-calculate-the-binomial-cumulative-distribution-function
(Title = How can I efficiently calculate the binomial cumulative distribution function?)
However, I need the negative binomial cumulative distribution function.
Is there a way to tweek ...
This is a design question.
Background: We get a web request into our system from many different websites (for a widget that we give out), from which we grab the referrer string (if it exists). We use the referrer to decide on some things within the application. The problem arises in that I need to look at a list of "sites" (urls, partia...
How can I find if a sorted array has an element a[j]=j in O(log n) time?(no duplicates)
...
If you've implemented the Hungarian Method exactly as given in Figure 11-2 of Combinatorial Optimization: Algorithms and Complexity, did you succeed without altering the pseudo-code in any [significant] way? To be specific, I'm referring to the corrected 1998 Dover edition, which is up-to-date with respect to the errata file dated Octobe...
Hi,
Given a set of points, what's the fastest way to fit a parabola to them? Is it doing the least squares calculation or is there an iterative way?
Thanks
Edit:
I think gradient descent is the way to go. The least squares calculation would have been a little bit more taxing (having to do qr decomposition or something to keep things ...
I was browsing through some interview questions and stumbled upon this. It got me tearing my hair apart.
Does anyone know how to implement a stack using queue?.
...
Hi,
Deleting a particular line/certain bytes from a file is very inefficient as there is a lot of reading and writing(re-writing) to be done. Is there anyway we can minimize work in such a process? Imagine if an entire file is a set of linked lists and as a user we know the structure of these linked lists then wouldn't it be wonderful a...
Everything seems to work fine in the algorithm besides the solve method. When it executes the program using a solvable Sudoku board, it says that it cannot be solved. I've tried everything I can think of in the solve method. I've tried debugging and it fails after the first row is tested. Any suggestions? Here is the full code so far:
...
I am working with some spreadsheet data and I have a set of cell regions that are of arbitrary bounds. Given any cell, what is the fastest way to determine the subset of regions which contain the cell?
Currently, the best I have is to sort the regions with the primary sort field being the region's starting row index, followed by its en...
Hi Folks,
I'm in the throes of writing a poker evaluation library for fun and am looking to add the ability to test for draws (open ended, gutshot) for a given set of cards.
Just wondering what the "state of the art" is for this? I'm trying to keep my memory footprint reasonable, so the idea of using a look up table doesn't sit well b...
I have an algorithm, and I want to figure it what it does. I'm sure some of you can just look at this and tell me what it does, but I've been looking at it for half an hour and I'm still not sure. It just gets messy when I try to play with it. What are your techniques for breaking down an algoritm like this? How do I analyze stuff like t...
Possible Duplicate:
Quickest way to find missing number in an array of numbers
Input: unsorted array A[1,..,n] which contains all but one of the integers in the range 0,..,n
The problem is to determine the missing integer in O(n) time. Each element of A is
represented in binary, and the only operation available is the functio...
This is a question in my paper test today, the function signature is
int is_match(char* pattern,char* string)
The pattern is limited to only ASCII chars and the quantification * and ?, so it is relatively simple. is_match should return 1 if matched, otherwise 0.
so, how to do, i am really dizzy on this?
thanks in advance!
...
Hello!
I am trying to make a game where a player have to find his way from Start to End on the Game Board.
As you see this Game Board contains a bunch of red circular obstacles. To win the game the player has to remove a minimum amount of obstacles. So my question is, how do I programatically find out the minimum amount of obstacles t...
I have a grid of cells (empty at beginning), and a collection of blocks which are rectangles or squares whose size are a multiple of a cell (for example, a block might be 2 cells by 3 cells). I won't know all the blocks in advance, but will have to place them as they arrive. In case anyone's wondering, this has to do with placing a bunch...
I have a non-weighted DAG graph. What I want to do is to find
all the paths in a greedy way and the path should contain at least K nodes,
and a given starting node.
Is there any existing algorithm/implmentation that does that?
For example I have the following graph:
my %graph =(36=>[31],31=>[30,22],30=>[20],22=>[20,8],20=>[1],8=>[5],...