An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.
0
votes
0answers
24 views
Debugging help facebook hacakathon problemset
I am trying to implement one of the simpler questions that was on the facebook hackathon 2013
...
0
votes
1answer
20 views
find number of string without certain substring
the problem is given N (1 <= N <= 10) string with length no more than 6, how can i calculate number of string with length L (1 <= L <= 1000000) without any of the n string as the ...
6
votes
0answers
58 views
Fast algorithm to optimize a sequence of arithmetic expression
Is there a fast algorithm solving following problem?
And, is also for extendend version of this problem
that is replaced natural numbers to cyclic group Z/(2^n Z)?
Problem:
For a given set of ...
3
votes
1answer
49 views
How many times string appears in another string
I have a large static binary (10GB) that doesn't change.
I want to be able to take as input small strings (15 bytes or lower each) and then to determine which string is the least frequent.
I ...
1
vote
1answer
28 views
Find solutions to an equation within two arrays
If you are given two arrays A & B, each with n positive numbers and the equation:
x^8 = y^6 + x^2y^2 + 10
Design an algorithm that runs in nlog(n) time that finds an x in A and a y in B such ...
0
votes
2answers
34 views
Longest Common Prefix property
I was going through suffix array and its use to compute longest common prefix of two suffixes.
The source says:
"The lcp between two suffixes is the minimum of the lcp's of all pairs of adjacent ...
-6
votes
0answers
35 views
Can't Determine a Dynamic Programming Algorithm Relation [closed]
I need to find the number of ways that a number, n can be written as the sum of powers of 2.
For example:
When n = 3,
Combinations = (1, 1, 1) and (2, 1)
# of Combinations = 2
The program is ...
0
votes
5answers
42 views
Return with a recursive function
I'm curious how return works when using a recursive function. For example, in the factorial function below, x will reach 1 before any calculations can actually occur.
int factorial (int x){
if ...
0
votes
1answer
27 views
AI algorithm possible solution for shortest path
I need advice for heuristic for minesweeper game. If found 10 fields without mine, i am curious how to estimate what should be the next field to open? I was thinking about finding possibility for ...
4
votes
2answers
104 views
O(1) extra space lookup data structure
I was wondering if there was a simple data structure that supports amortized log(n) lookup and insertion like a self balancing binary search tree but with constant memory overhead. (I don't really ...
-2
votes
1answer
28 views
Eliminating vertices from a graph [closed]
From Skiena's Book,
Design a linear-time algorithm to eliminate each vertex v of degree 2 from a graph by replacing edges (u,v) and (v,w) by an edge (u,w). We also seek to eliminate multiple copies ...
1
vote
1answer
25 views
Algorithm for finding a Hamilton Path
From Skienna's Book,
The problem of testing whether a graph G contains a Hamiltonian path is NP-hard, where a Hamiltonian path P is a path that visits each vertex exactly once. There does not have to ...
0
votes
0answers
20 views
Algorithm for calculation of the Boyer-Moore good suffix table
Can somebody give a clear explanation of the calculation procedure of the good suffix table used in the Boyer-Moore string search? ...
0
votes
1answer
37 views
How can Knuth-morris-pratt algorithm be implemented using mapreduce in python?
I have been trying to implement KMP in hadoop using python, But don't know how to split the KMP python program as mapreduce.
Can someone please help me ?
-1
votes
1answer
20 views
Tree, a DAG, directed acyclic graph and my approach [closed]
first of all - great site!
Here is my problem, I am studying for an interview, and I ran into this problem,
http://i.stack.imgur.com/JmdER.png
I am asked, Suppose an arithmetic expression is given ...