Tagged Questions
0
votes
0answers
110 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
179 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
461 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
5answers
849 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 ...
1
vote
2answers
485 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 ...
5
votes
4answers
561 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
367 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
190 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
132 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 ...
4
votes
2answers
477 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
2k 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
937 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
603 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 ...
8
votes
4answers
1k 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
327 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 ...
16
votes
6answers
1k 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
521 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
231 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
1k 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
388 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?
...
7
votes
6answers
918 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
217 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 ...
