I'm studying the lock-free (en-,de-)queue algorithms of Michael and Scott. The problem is I can't explain/understand (nor the paper does, apart from the comments in the code itself) a couple of lines.
Enqueue:
enqueue(Q: pointer to queue_t, value: data type)
E1: node = new_node() // Allocate a new node from the free list
...
I'm writing software to provide feedback to people across many categories. For example, I might have 30 employees and 40 standards of evaluation (e.g. "arrives on time," "is polite," "appears to brush his teeth," etc). At arbitrary times, the supervisor can submit a piece of feedback like "employee 3 gets a 5/5 for standard 8 (he smell...
I'm looking for a data structure with which I can find the most frequently occuring number (among an array of numbers) in a given, variable range.
Let's consider the following 1 based array:
1 2 3 1 1 3 3 3 3 1 1 1 1
If I query the range (1,4), the data structure must retun 1, which occurs twice.
Several other examples:
(1,13) = 1
(...
typedef struct node
{
struct node *leftChild, *rightChild;
int value;
} bst;
void insert(bst* b, int i)
{
b=malloc(sizeof(b));
b->value=i;
b->leftChild = NULL;
b->rightChild = NULL;
printf("[%i]",b->value);
return;
}
main()
{
bst* b...
I stumbled across the Wikipedia page for them:
http://en.wikipedia.org/wiki/Fusion_tree
And I read the class notes pdfs linked at the bottom, but it gets hand-wavy about the data structure itself and goes into a lot of detail about the sketch(x) function. I think part of my confusion is that the papers are trying to be very general, a...
For a sequence of values, how would one find the sorted middle 50% of the sequence in Boost Accumulators?
For example, let's say that I have the following sequence,
25, 21, 9, 13, 17, 19, 12, 29, 50, 97, 10, 11.
The middle 50% data I would like to have is as follows:
13, 17, 19, 21.
Of course, one can sort the sequence, which now beco...
Can anyone give me an example of situation where a Deque data structure is needed?
Please don't explain what a deque is...
...
I'm trying to write an interface for communicating with a network protocol, but the IEEE document describes the protocol at the bit level with information split accross a single byte.
What would be the best way to go about handling a C typedef such as
typedef struct {
Nibble transportSpecific;
Enumeration4 messageType;
UIntege...
I'm sure there's a better way to do this.
I'm trying to create a class HashTable that is given a size at instantiation, so it can't be given a size at design time, so I can't use an array as my internal representation of the table, as far as I know.
So here's what I'm trying to do:
#include <vector>
#include <iostream>
#include "Nodes...
In my program I have some cubes (simple, xyz location, xyz size). I want bo be able to take one of these cubes and 'Subtract' another cube from it.
So my question, what is a good generic data structure to represent the resulting 3d object, and what kind of algorithm is used to subtract a 3d solid from another?
...
has anyone of you ever dealt with job scheduling problems with Java?
I have to work on a resource-constrained project scheduling problem and want to ask for some practical tips. Are there any good libs available for implementing algorithms? What are efficient data structures I should use?
edit:
It seems like i have not explained it rig...
An N-ary tree has N sub-nodes for each node. If the tree has M non-leaf nodes, How to find the no of leaf nodes?
...
What data structure would be best for a non-tree (in the graph theory sense), path-saved, troubleshooting flow for a web troubleshooting site?
In plainer words, if I'm wanting to model a troubleshooting flow, such that it's not strictly in a "downward" direction towards a resolution or contact point, is there a more specific structure t...
Is there a Haskell library that allows me to have a Map from ranges to values? (Preferable somewhat efficient.)
let myRangeMap = RangeMap [(range 1 3, "foo"),(range 2 7, "bar"),(range 9 12, "baz")]
in rangeValues 2
==> ["foo","bar"]
...
I've looked at different papers and here is the information that I've gathered:
SGI implementation and C cords neither guarantee O(1) time concatenation for long ropes nor ~log N depth for shorter ones.
Different sources contradict each other. Wikipedia claims O(1) concatenation. This page says that concatenation is O(1) only when one ...
Hi,
Im looking for a good and simple implementation of a linked list in Pascal.
As Im a Pascal beginner it would help me alot as a study material.
Thanks for any tips.
...
I'm writing code for a hybrid data structure for school, and am debugging the code. Basically, this structure is a combination of a Double Linked List and an Array, where each list node contains an array of set size. Since this is an ordered structure, a provision has to be made to identify and split full arrays into equally into two n...
i want to find an object with O(logN) and also remove with O(log N) - but no go to balanced tree implementation..
any idea's for that?
...
What are the applications of red-black trees? Is there any application where only RB Trees can be used and no other data structures?
...
I need to implement a data structure in C#/SQL Server that is a little bit tree and a little bit graph. I can think of how to brute force this, but performance is very important. That is where I need help.
Here are the requirements:
1) There are n root nodes.
2) Each node can have n children.
3) Each node is a list.
4) Each node can...