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.

learn more… | top users | synonyms (2)

3
votes
1answer
35 views

O(klogn) time algorithm to find kth smallest element from a Fenwick-Tree

I mean to find the kth smallest actual frequency in a Fenwick-Tree in O(k log(n)) time. If my data is: Tree = [1,3,4,10,13] Actual frequency = [1,2,1,6,3] So the second smallest element would be at ...
0
votes
0answers
14 views

Infinite Scrolling Background Layer in a simple iphone game

I am trying to make a doodle jump game alike, and though that an infinite scrolling background would fit in. So I have created a layer which holds two empty nodes, layerA positioned at the bottom and ...
2
votes
0answers
10 views

collision prediction using minkowski sum

I want to use the minkowski sum to predict the exact point of collision between two convex shapes. By my understanding the point where the velocity vector intersects with the minkowski sum is the ...
0
votes
0answers
44 views

How do you come up with algorithms? [migrated]

I picked up some Project Euler questions today and decided to find more effective ways to Answer the questions l had already answered. So on the question about finding the sum of the even Fibonacci ...
-1
votes
2answers
53 views

Which is the most clever solution to initialize a binary a tree using Python?

Let's imagine we have the following class: class Tree: def __init__(self, value, right=None, left=None): self.value, self.right, self.left = value, right, left tree = Tree(75, Tree(95), ...
0
votes
1answer
45 views

Combinatoric Optimization - Enumerating all Subsets that Contain a Given Set

Given a set of sets S = { s1, s2, s3 .. } and a set of elements X = { x1, x2, x3 .. } how can I enumerate all sets Y where the elements of set Y are drawn from S with replacement, and X is a subset of ...
1
vote
0answers
17 views

Searching for Genetic Programming framework/library

I am looking for framework, or library that could enable working with genetic programming (koza's style) not only by using mathematical functions, but also with loops, variable or constant assignment, ...
1
vote
2answers
23 views

Drawing overlapping circles with alpha channeling

This question has sort of been answered here: Combined area of overlapping circles My problem is more specific though. I have an arbitrary number of arbitrarily sized circles inside other arbitrarily ...
0
votes
1answer
33 views

Finding long paths

I have a sparse unweighted directed graph of 1000000 nodes and I would like to find all simple paths of length 5. I know there will be very few simple paths of length 5 (maybe only one). I see from ...
-1
votes
3answers
26 views

String match searching in sorted list

I got an array with sorted strings. var sorted_array = ['a', 'b', 'ba', 'bb', 'bc', 'c', 'd']; I want to search the array for strings which start with another string ('b'), using a binary search ...
4
votes
3answers
97 views

Algorithm complexity

I got this problem "Implement this method to return the sum of the two largest numbers in a given array." I resolved it in this way: public static int sumOfTwoLargestElements(int[] a) { int ...
4
votes
4answers
95 views

Generate a number is range (1,n) but not in a list (i,j)

How can I generate a random number that is in the range (1,n) but not in a certain list (i,j)? Example: range is (1,500), list is [1,3,4,45,199,212,344]. Note: The list may not be sorted
1
vote
1answer
16 views

Finding the rank of the Given string in list of all possible permutations with Duplicates

I was trying to find the Rank of the given string in the list of permutations and was hoping someone can find the bug. function permute() { var W = $('input').val(), C = []; for (var ...
0
votes
5answers
106 views

how to calculate 2^32 without multiplying numbers directly?

the simplest way to calculate 2^32 is 2*2*2*2*2......= 4294967296 , I want to know that is there any other way to get 4294967296? (2^16 * 2^16 is treated as the same method as 2*2*2.... ) and How ...
-1
votes
0answers
17 views

Finding specific regions in 3D data set

I have this 3D cloud point data set of face. Also i have the 26 landmark points coordinates of that face for example left mouth corner, left eye corner... Is there any way to find the data points that ...

1 2 3 4 5 2075
15 30 50 per page