1
vote
2answers
225 views

2D linked list vs. multidimensional array/vector

I hope that programmers is the correct stack exchange for this, as it is quite a concept based question. I'm working on a data structure in C++ that is a represents data in 3D space. The x-y plane is ...
3
votes
3answers
233 views

Data Oriented Design - impractical with more than 1-2 structure “members”?

The usual example of Data Oriented Design is with the Ball structure: struct Ball { float Radius; float XYZ[3]; }; and then they make some algorithm that iterates a std::vector<Ball> ...
0
votes
1answer
110 views

Traversing an AST using Visitors

I'm writing a compiler for a C-like language, and I'm looking for an elegant way to traverse my abstract syntax tree. I'm trying to implement the Visitor pattern, although I'm not convinced that I'm ...
1
vote
1answer
155 views

Chained ruleset parsing and evaluation code: recommendations?

So I have to write a filtering system, which may apply preprocessed ruleset to data - and trigger some actions defined in the ruleset while continuing its evaluation. <ruleset name="1"> ...
1
vote
3answers
301 views

Choice between 1-dimensional and 2-dimensional array

I'm implementing the Chessboard class to represent the chessboard. I've to implement the transformations (reflections and rotations) on the chess board possible. The possible transformations includes ...
1
vote
2answers
158 views

Data retrieval and indexing

I have around 800,000 rows of data stored in the boost shared memory from the database. The data are in the form: Id Color Length Size 1 1 2 ...
1
vote
0answers
134 views

How to organize points on a sphere in bins and navigate between bins?

I'm having trouble coming up with a suitable way to navigate through a set of star coordinates in the Equatorial Coordinate System. My goal is to display those which are within a given range of ...
1
vote
1answer
259 views

Is there already a “Binder” data-structure?

I was thinking of a data structure that I cannot describe better than with the word "book", or more exactly "binder". I was wondering if this had already been implemented in libraries like Boost or ...
6
votes
3answers
760 views

Faster reads, on an infinite grid plane, than using a hash table?

In the past, I've had alot of success just using a .NET Dictionary, with a TKey consisting of the X,Y coordinates merged together. However its read performance, despite being amortized constant time, ...
0
votes
1answer
318 views

Comparing performance of different C++ self-made tree data structures

I have two tree data-structures that I made in C++ , and they give a response for range queries/point queries in that program. I am using Ubuntu. I need help in understanding the way to compare the ...
-1
votes
2answers
75 views

Store a tree with near next neighbours

I would to find an efficient structure (speed and volume) to store nodes and their neighbourhood. My input is build out of stings in the following format ./X/Y.log where X ∈ [0,359] and Y ...
0
votes
1answer
289 views

What data structure is suitable for implementing dynamic huffman encoding and decoding on a piece of text?

Some pseudo code or resources will be appreciated.I was thinking if implementing it in form of a BST stored in an array. However,not all operations can be performed easily using this approach. I am ...
-2
votes
2answers
261 views

About Artificial Intelligence [closed]

I am interested in starting a career in artificial intelligence. Can anyone suggest how I could prepare for this? What languages should I study that would be best for this career choice?
1
vote
3answers
1k views

The best way to store dictionary from file

I'm working on a translator in C++. Basically I want to parse the file with translations and store it in my program, so I can perform search through the words and simply access the corresponding word. ...
6
votes
3answers
2k views

What is the best way to store a table in C++

I'm programming a decision tree in C++ using a slightly modified version of the C4.5 algorithm. Each node represents an attribute or a column of your data set and it has a children per possible value ...
2
votes
2answers
2k views

Nested Enum type in C++ or C#?

I've come across a recurring issue in a few of my recent projects in which I find myself using enums to represent state, or type, or something else, and I need to check against a few conditions. Some ...
7
votes
4answers
9k views

What is the point of using lists over vectors, in C++?

I've run 3 different experiments involving C++ lists and vectors. Those with vectors proved more efficient, even when a lot of insertions in the middle were involved. Hence the question: in which ...
7
votes
2answers
1k views

Using a stream manipulator (endl) or a newline escape character (\n)?

I don't have a specific context in which I'm asking the question, but while I was reading a beginner book on C++ I noticed the use of both an endl stream manipulator and a newline escape character ...
5
votes
2answers
245 views

Data structures for storing finger/stylus movements in drawing application?

I have a general question about creating a drawing application, the language could be C++ or ObjectiveC with OpenGL. I would like to hear what are the best methods and practices for storing strokes ...
6
votes
1answer
155 views

Unit testing a text index

Consider a text index such as a suffix tree or a suffix array supporting Count queries (number of occurrences of a pattern) and Locate queries (the positions of all the occurrences of a pattern) over ...
5
votes
2answers
746 views

Efficient Data Structure for holding a graph

Problem Link - http://opc.iarcs.org.in/index.php/problems/NUMTRIPLE In my opinion, the problem can be solved by a data structure, that shows how each number is connected to another, and via recursion ...
2
votes
1answer
4k views

Most efficient Implementation a Tree in C++

I need to write a tree where each element may have any number of child elements, and because of this each branch of the tree may have any length. The tree is only going to receive elements at first ...
6
votes
3answers
2k views

Data classes: getters and setters or different method design

I've been trying to design an interface for a data class I'm writing. This class stores styles for characters, for example whether the character is bold, italic or underlined. But also the font-size ...
0
votes
5answers
1k views

Learning basic algorithms - better C or C++? [closed]

I'm studying fundamental algorithms (quicksort, mergesort, binary trees, etc..) and I'm going to re-code every algorithm by scratch to learn how they work. Should I code them in C or C++? I think with ...
9
votes
4answers
2k views

Analyzing Memory Usage: Java vs C++ Negligible?

How does the memory usage of an integer object written in Java compare\contrast with the memory usage of a integer object written in C++? Is the difference negligible? No difference? A big difference? ...
4
votes
1answer
604 views

Which data structure to represent a triangular undirected graph

I was wanting to create a graph similar to this in C++: The one I will implement will have more edges and vertices, but will use this triangle style. I was wanting to create something that I could ...
15
votes
6answers
3k views

Is it a good practice to use smaller data types for variables to save memory?

When I learned the C++ language for the first time I learned that besides int, float etc, smaller or bigger versions of these data types existed within the language. For example I could call a ...
6
votes
2answers
858 views

What data structure could I use for modeling a network of nodes and edges?

My application needs to model of and perform operations on a network with 40 - 50 nodes and typically less than 6 edges per node. Both nodes and edges are objects with around 1K data each. During ...
1
vote
2answers
397 views

What is the best way to insert range of values into a datastructure

If I have a datastructure which is the fastest way I could insert values into it in a specified range? For example if I had a method: myDatastructure var=new myDataStructure(); var.insert(2,1000); ...
3
votes
2answers
2k views

What is the advantage of using map datastructure?

I am a member of some online coding website and today when I submitted a solution in C++, I saw there were much better answers in C++ itself which took considerably less time. The solutions were open ...
1
vote
3answers
564 views

Finding all nearby points in a point cloud

What's the best way to store 3D point cloud data, optimising for time it takes to find all the points in a sphere of 3D space, and also for time it takes to insert new data points into the data set? ...
8
votes
6answers
2k views

How far to go with typedef'ing primitive types like int

Do you bother typedef'ing most of your number types like this? Or do you just use "int" in most places? It might be more important in my current project with is client / server based and the types ...
1
vote
4answers
269 views

Use the terms “vector” or “array” in high level discussion of C++ code

When I write high-level documentation about what an algorithm does, I use the term "array" to refer to the data structure on which the algorithm operates even though the actual data structure is an ...