C :: Compact Table Representation - Data Structure
Jul 19, 2013
Data structure problem. I have a table of the following format:
Code:
C/R 1 2 3 4 5 6 7 ...
1 x x x
2 x
3 x
4 x
5 x x x
6
... s
So my column and row names are integer numbers if an outcome of some game for a certain column and row lable is a match then we have an x on that position. The size of the integer names for both column and row name is quite large (let us imagine that it is so large that you would need a machine with 500GB of RAM memory to hold this type of table even if x's are treated as regular char's) . In every row there is at least one x and for every column the same holds for the columns. However, the number of x's for a row or a column can be bigger then 1. How to store this table efficiently? (using as less memory as possible).
The data structure should be efficiently accessed in the column fashion that is, if i want to get all values for column 4 I should be able to do that in O(N) time where N= the number of rows.
View 10 Replies
ADVERTISEMENT
Jul 21, 2014
I have matrix in C with size m x n. Size n isn't known. I want to have operations on matrix such as : delete first element and find i-th element. (where size m woudn't be too big , from 10 to 50 columns).
What is more efficient to use, linked list or hash table? How can I map each column of matrix to different element of linked list or hash table; depends what I choose to use?
View 5 Replies
View Related
Mar 25, 2013
I have a C# .NET Application which get data from QuickBooks via the ODBC Driver and save the result to C# data table. So, I want to transfer this data table to a mysql table on my own server. That's the code I use:
using System.IO;
using MySql.Data.MySqlClient;
//Add mysql dll on the .NET Tab in Project's references
string connStr = "DSN=QBTest;";
string myServerAddress = "192.168.0.243";
string myDataBase = "CostTest";
[Code] ....
View 2 Replies
View Related
Mar 24, 2014
is it possible to make something like that?
struct type_name
{
char Status[i];
string Status[j];
.
.
} object_names;
The problem is I dont know how many statuses my object will have. Is it possible to make it in an dynamic array?
View 3 Replies
View Related
Sep 19, 2013
My specific request is for retrieving values that are stored to a CompactFlash card. I am able to store values (we call them recipes) to the CompactFlash card as .csv file. I just haven't been able to figure out the code to retrieve this information back to the touchscreen.
Code:
// Create a new folder if it doesn't exist
CreateDirectory("/recipes");
//Create the file if it doesn't exist
CreateFile("/recipes/recipe.csv");
//open the file
hfile = OpenFile("/recipes/recipe.csv", 2);
[Code]....
Now with that said, I would like to retrieve these values from the .csv file.
View 7 Replies
View Related
Sep 13, 2013
I know how to make a namespace i just want to know why someone would. because it just seems like a way to show a bunch of variables and functions into a compact area.
View 3 Replies
View Related
Feb 26, 2015
Project Golfer.cpp
So when you enter the number 99 its supposed to quit the program and it wasnt so i fixed that then i noticed that if you don't hit the green its supposed to loop back to a certain point but it was going to far back so i put a goto statement in and now it wont output my data table.
View 1 Replies
View Related
Jul 15, 2014
I'm trying to union eleven tables to call out data. Parent table is 'Events', child tables are 'SR1Laptimes', 'SR2Laptimes' and so on (there are ten SR... tables). Primary key in all tables is EventName. Parent/Child relationship is Events.EventName/SR1Laptimes.EventName etc All tables that start with SR have the same Schema. I'm trying to call out MIN(Q1) across all table but first need to Union them I believe. Here is my code.
myCommand.CommandText = "SELECT MIN(Q1), MIN(Q2), MIN(Q3), MIN(Q4), MIN(LaptimesMinutes), MIN(LaptimesSeconds) FROM (SELECT * FROM Events UNION ALL SELECT * FROM SR1Laptimes UNION ALL SELECT * FROM SR2Laptimes) WHERE (Events.Track = @track) AND (Events.Number = @number) AND (Events.Rider = @rider)";
myCommand.Parameters.AddWithValue("@track", analysisTrackComboBox.Text);
myCommand.Parameters.AddWithValue("@number", analysisNumberComboBox.Text);
myCommand.Parameters.AddWithValue("@rider", analysisRiderComboBox.Text);
View 4 Replies
View Related
Sep 17, 2014
I am trying to make a table class that will be able to have multiple columns of data. I want it to have something to hold data (I was using a 2D vector for only one data type) in it, somewhat like a pair, but for any number of data types. The class is a template to make it generalized.
I have looked a little at variadic templates, but I don't know how to declare the vectors for each data types then.
View 4 Replies
View Related
Nov 5, 2013
I have an abstract based class and three derived classes. I also have a templated hash table class(using chaining as my collision resolution method, an array of stl lists), and a class to parse commands from a file, this also holds the instantiation of the hash table. My question is that since my command parsing class's constructor instantiates the hash table in the main driver(unable to modify) how can I make this dynamically allocated using data from the file?
template<class T>
class hashTable{
public:
hashTable(int size);
~hashTable();
[Code] .....
View 3 Replies
View Related
Jul 12, 2014
I am having a lot of trouble trying to save and upload a data table from a text file ,the data table which is bound to a datagrid, creates its own columns at the formloading event, and everytime a user clicks a button row is added to the data table. With the loading i put this code which i thought would read a text file and put all the content my datatable however a exception pops up saying Duplicate Name exeption. Heres the loading piece of code :
{
string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\DG1.txt ";
if(File.Exists(filePath))
{
StreamReader reader = new StreamReader(filePath);
string line = reader.ReadLine();
[Code] ....
View 11 Replies
View Related
Sep 24, 2014
How to validate the data if the data already exist in the table record in c#?
For example I wanted to add the student roll no. if roll no. is 134 and if we are adding rollno. 134 student then we get the warning like roll no. 134 is already exist ....
View 1 Replies
View Related
Oct 9, 2013
how to solve this undeclared error when compiling this code. I assume it has something to do with scope.
C code - 47 lines - codepad
Code:
#include <stdio.h>
int main(void) {
struct bank_account {
[Code].....
View 3 Replies
View Related
Mar 18, 2013
I am trying to create an structure of data with following elements:
struct stest {
std::vector<int> na;
std::vector<double> nb;
std::vector<double> va;
std::vector<double> vb;
std::vector<double> vc;
std::vector<double> vd;
}
I would like to modify the composition of this struct, so that I can create a special data structure by
vector<stest*> data_test;
for(int i = 0; i < 10; i++)
data_test.push_Back(new stest);
within this structure, I have: only one na and one nb, but ten groups of combination of va, vb, vc, vd that I can access by pointer, which means na, nb are independent but still inside of the structure.
View 2 Replies
View Related
Apr 4, 2013
I'm currently having the following data structure:
typedef struct {
int a;
int b;
} S;
<vector <vector<S> > v;
Now I also have different pointers that can be set in connection with one instance of the above shown vector. Therefore I was attempting to work with a map:
map<p*, <vector<vector <S> >, vector<sI> > m;
However, it seems like it doesn't work that way. Therefore I tried the following:
map<p*, map<<vector<vector <S> >, vector<S> > > m2;
With this attempt I do now, however, get another mistake here, that [] cannot be used here:
S s;
m2[p][0].push_back(s);
View 13 Replies
View Related
Dec 14, 2013
Does it use Linked List or Dynamic Array?
I want to know this because if I happen to want to use a lot of insertions and deletions then it is more efficient to make use of Linked List instead of Dynamic Array.
While, if I happen to want to just access random parts of the Array, then Dynamic would be more efficient.
I want to make a 2D game using SDL engine and I need to check whether or not an object is colliding with a list of other objects. (because there would be more then one objects on the map.)
Since I would simply be accessing each object sequentially to check whether or not the object is colliding with another the object in question, and since any of those objects could "die" and be deleted at any time, it makes more sense to use Linked List then a Dynamic Array.
View 8 Replies
View Related
Jul 2, 2014
I created one structure and the created structure is using in few more structures, but i did not get the proper data.
typedef struct _MSG_HEADER{
//MESSAGE_HEADER 40 bytes
short iApiTcode;
short iApiFuncId;
int LogTime;
char AlphaChar[2];
[Code]...
My requirement is have to fill the MessageHeader structure & we can use that header in all the structures entire program.
View 3 Replies
View Related
Nov 26, 2014
I have two structs like below,
struct SP {
string sp1;
string sp2;
};
struct SL {
[Code] ....
How to add data to slVect ?
View 6 Replies
View Related
Oct 27, 2014
When we want to use custom classes for the STL set data structure, how to do it?
I look around and see people passing comparators, overloading operator(), and also overloading operator< in the class itself.
Which one's the idiomatic c++ way?
View 1 Replies
View Related
Mar 22, 2013
I have this data store into a data structure.
i j x y w h w*h
0 0 0 0 9 11 99
1 0 0 11 9 10 90
2 0 0 21 9 11 99
0 1 9 0 8 12 96
1 1 9 12 8 7 56
2 1 9 19 8 6 48
[Code]...
Code:
struct data {
//Here
/*! horizontal position */
int x;
/*! vertical position */
int y;
/*! width */
int w;
/
[Code]...
data and then i have an array /*! it contain group_id of each data line*/ int group_id[16]={0,0,0,0,3,3,1,1,1,3,3,2,2,2,2,1}; I never worked with 2D array before. My problem is that i want to create a 2D array of that data for example if i write data[j][i].. It will give me the reference/value of all data lines that belongs to j column, and same with group_id[j][i]. I don't know how i can store these structure vaules in this like 2D array.
View 2 Replies
View Related
Nov 20, 2013
Corporate Data Sales
Write a program that uses a structure named CorpData to store the following information on a company division.
Division Name(North, South, East, Or West)
First quarter sales
Second quarter sales
Third quarter sales
Fourth quarter sales
Total annual sales
Average quarter sales
Include a constructor that allows the division name and four quarterly sales amounts to be specified at the time a CorpData variable is created.
The program should create four variables of this structure, each representing one of the following corporate divisions: North, South, East and West. Each variable should be passed in turn to a function that calculates and stores the total annual sales and average sales for that division.
Once this has been done for each division, each variable should be passed in turn to a function that displays the division name, total sales, and average sales.
Here is my code:
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
struct CorpData {
[Code] ....
View 1 Replies
View Related
Feb 9, 2013
To check if a set B is a subset of A or not. Which data structure to be used to store set A for quicker response(linked list/hash map)? What if I want to check intersection also?
View 1 Replies
View Related
Mar 7, 2014
So I've been working on implementing a stack data structure as an ADT, the program compiles, but when I try and push elements on top of the stack, for some reason the stack is full.
#ifndef H_stackADT
#define H_stackADT
template <class Type>
class stackADT {
public:
virtual void initializeStack() = 0;
virtual bool isEmptyStack() const = 0;
[Code]...
View 4 Replies
View Related
Nov 3, 2013
Given a set of different types of paired symbols; determine whether it is balanced or not (the opening and closing version of each type are paired correctly). Any other type of characters may appear in the input will be neglected.
For example:
(**(*[*])****) is balanced, also [{}**[]**()]** is balanced. But ((*{*)*}) is unbalanced as well as [()***[]***{*(*)}.
Write a C++ program that requires a string containing and expression as an input from the user and check for balanced bracket pairs using stack data structure.
Here is my code which give me nothing when I run it.
#include <iostream>
#include <string>
using namespace std;
class CustomStack {
[Code] ....
View 1 Replies
View Related
May 23, 2014
I want to know if you have made Sudoku game in c++, which kind of data structure did you use? shortly, which part of the game did you use for? [Array, Stack, Queue, Linked List, Binary Search Tree]
View 5 Replies
View Related
Apr 13, 2013
I need building a complete graph from a file. The format in the file is as follows.
[ vertex 1] [ x_coordinate 1] [ y_coordinate 1] [cityname 1]
[ vertex 2] [ x_coordinate 2] [ y_coordinate 2] [cityname 2]
. . .
[ vertex n] [ x_coordinate n] [ y_coordinate n] [cityname n]
What kind of data structure shall I use in order to store date in a complete graph so there is an edge between every pair?
View 7 Replies
View Related