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.
-4
votes
0answers
15 views
formula to count undirected graph is its connected acyclic subgraph formula
1
B---------------C
/ \ / \
3/ \ 4 4/ \6
/ \ / \
...
1
vote
1answer
46 views
“Charge changing” algorithm
First of all I'm not sure how to name this problem. If anyone have better idea feel free to change it or tell that I do so.
Let's say I have two strings s1, s2 containing '+' and '-', which means ...
0
votes
0answers
23 views
Mapping lat/long to grid
I have a question that I've been googling for a while but haven't found a answer to exactly what I'm trying to do. I hope someone has solved this before and has a quick answer.
I am trying to map a ...
-6
votes
0answers
28 views
Making tarot card game in java [closed]
I would like to make a java game. Specifically a simple tarot card game. There are 21 cards in tarot. Users are addressing a specific question in for themseleves. Tarot is not intended to answer ...
0
votes
1answer
32 views
Make Correspondence between Two different Pointers to the same Class
Suppose I have a city map that I want to make a copy of. The problem is that from and to in the road class are pointers in memory for that particular cityMap object. Making a new object independent of ...
0
votes
0answers
30 views
Steganography. Algorithm of Koha Zhao. Wrong extraction
I'm trying to realize method of Koha-Zhao.
Test matrix
my @matrix = (
[0,19,1,1,0,0,0,1],
[0,1,1,1,0,0,0,1],
[0,1,1,1,0,0,1,1],
[0,0,1,1,0,1,0,1],
[0,1,0,1,1,0,0,1],
[0,1,1,0,0,0,0,1],
...
1
vote
1answer
36 views
Fastest KV data structures for merging unique keys?
I currently have around 15 worker threads processing data in a CPU-bound loop. Each time a result is determined, an RW lock is obtained so the results can be stored in a shared KV structure (a hash ...
-6
votes
0answers
46 views
Chudnovsky algorithm [closed]
I am having trouble to implement Chudnovsky algorithm in C++ for generating the digits of pi upto 10^7. Can anyone help me with some code or reading material. Specially the problem is on how to save ...
1
vote
0answers
36 views
How to build an inverted index for multi-dimensional attributes?
I have data in the form of userID-> (col1,col2,col3), where each user has a set of (col1,col2,col3) values)
I organize (col1,col2,col3) into a KD-Tree and perform nearest neighbour queries on it. ...
3
votes
1answer
29 views
barnes hut tree endlessly looping between insert and internalInsert
I'm trying to implement this data structure, a Barnes-Hut Octree, and I keep running into an endless loop, terminated by an out of memory exception.
The complete fiddle is here: ...
-1
votes
0answers
23 views
Visualization of graph on client side
I have one question about visualization on JavaScript. I read a lot of questions and articles but i have more specific needs
1) custom renderer - abbility to write a node by myself
2) draw an ...
1
vote
1answer
45 views
How do you find the optimal assignment of pupils in classes?
23 pupils from level A, 24 from level B and 30 from level C need to be assigned into three classes.
The classes need to be almost exactly of the same size.
Different levels can be mixed into a single ...
-1
votes
0answers
14 views
edge weights in range 1 to W-kruskals or prims
When edge weights are in range 1 to W then which algorithm prims or kruskals is more suited to calculate the minimum spanning tree?
In kruskals sorting takes O(E+W) time by counting sort.So time is ...
-7
votes
2answers
46 views
number of ways can you climb if u use either 1 or 2 at a time [closed]
I faced an interview and was asked the following question :
Given n stairs, how many number of ways can you climb if u use either 1 or 2 at a time?
I think recursion might be useful?.. Is there any ...
1
vote
1answer
49 views
multiple search key for binary search tree in linux C
I define a binary tree as a search table. The tree is a linked list binary tree, the node is like
typedef struct node{
int key;
char *buf;
...
}node_t;
typedef table_t node_t *;
so I ...