I have this function which works fine in visual studio:
btw this is code for a c++ stl map, where map is Life and the iterator is di.
void structure::deletion_process()
{
for (di =...
Type: Posts; User: spikestar
I have this function which works fine in visual studio:
btw this is code for a c++ stl map, where map is Life and the iterator is di.
void structure::deletion_process()
{
for (di =...
when i have
this:
int row=100000;
int col = 100000;
int prec =1;
long selection = ((row * col) * prec)/100;
void tree1::remove(int coX, int coY)
{
//Locate the element
bool found = false;
if(isEmpty())
{
cout<<" This Tree is empty! "<<endl;
return;
}
...
so the what i have it now, how can i pass in the root into the func without changing my code
Hi,
in a header file
I have a class called tree.h;
inside that class I have a struct
struct tree_node
it would be for the game of life, so not sure under which category it falls under
x and y would be ints
Can some on recommend what hashing function I could use for two points, (x,y) co ordinates?
yes I have included my header file, I just provided the relevant inserts from my code.
In my header file:
i have a method:
entry.h
entry *next;
entry *getNext();
If I do a DFS (Depth first search on a undirected graph) I can get different solutions, or is there still only one solution?
Oh I understand what I done wrong with the first example. Didn't read the code carefully. Thought it was i++ not i*2.
MK27 I'm not sure I quiet understand your reply for the first and second codes.
For the third code wouldn't the first loop run N times and the second would run N-1 times?
making it N^2 - N...
m = 0;
for (i=1; i<n; i = 2*i)
m = m + i;
Is the complexity of the above code N or N^2?
I believe its N since the variable m wont effect the time of the function.
I think the issue is how Im the referencing the parent node. The way im doing it is when allocating the memory for node i declare parent as null.
and then i have a function the decides where the...
This is my left rotate function:
static void rotate_left(Tree * t, Node *x)
{
Node * y;
Node * nil = t->nil;
y=x->right;
x->right=y->left;
Just type:
while(puramnt != NULL)
{
//put your code for entering data with your if statements
I'm trying to find out what is the total memory allocated in bytes for the words being inserted.
I managed to find the time, but I cant get my program to display "Your program size is ______ bytes". Any ideas?
Thank in advance
i thought there is a function that can get time or something...gethrtime() ?????
How could I make a c program that loads a file, display the time it took to load the file and display the size of the program in bytes?
I would just like to know how if its possible to convert tokenized words into lower case.
Hi, for my school assignment I need to load words of a text file into a binary search tree. Afterwards I'm required to prompt the user to enter a word. The program should scann and find if the word...
would any one be able to give me full explanation of the code and how it works? It's quiet frustrating me now ...
strcpy(ch, alpha);
this line copies the string array alpha to array ch;
putchar(*pch++);
prints the character at ch[0] which is a, and the pch is incremented by +1 and is now pointing to ...