Search:

Type: Posts; User: spikestar

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,352

    stl map erase

    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 =...
  2. Replies
    9
    Views
    1,427

    long int issue

    when i have
    this:


    int row=100000;
    int col = 100000;
    int prec =1;
    long selection = ((row * col) * prec)/100;
  3. Replies
    0
    Views
    3,125

    BST delete function

    void tree1::remove(int coX, int coY)
    {
    //Locate the element
    bool found = false;
    if(isEmpty())
    {
    cout<<" This Tree is empty! "<<endl;
    return;
    }
    ...
  4. Thread: get method

    by spikestar
    Replies
    6
    Views
    1,055

    so the what i have it now, how can i pass in the...

    so the what i have it now, how can i pass in the root into the func without changing my code
  5. Thread: get method

    by spikestar
    Replies
    6
    Views
    1,055

    get method

    Hi,

    in a header file

    I have a class called tree.h;

    inside that class I have a struct


    struct tree_node
  6. Replies
    6
    Views
    2,252

    it would be for the game of life, so not sure...

    it would be for the game of life, so not sure under which category it falls under
  7. Replies
    6
    Views
    2,252

    x and y would be ints

    x and y would be ints
  8. Replies
    6
    Views
    2,252

    Hashing function

    Can some on recommend what hashing function I could use for two points, (x,y) co ordinates?
  9. Replies
    3
    Views
    891

    yes I have included my header file, I just...

    yes I have included my header file, I just provided the relevant inserts from my code.
  10. Replies
    3
    Views
    891

    Identifer not found

    In my header file:

    i have a method:


    entry.h

    entry *next;

    entry *getNext();
  11. Thread: DFS

    by spikestar
    Replies
    2
    Views
    1,135

    DFS

    If I do a DFS (Depth first search on a undirected graph) I can get different solutions, or is there still only one solution?
  12. Thread: Complexity

    by spikestar
    Replies
    9
    Views
    1,918

    Oh I understand what I done wrong with the first...

    Oh I understand what I done wrong with the first example. Didn't read the code carefully. Thought it was i++ not i*2.
  13. Thread: Complexity

    by spikestar
    Replies
    9
    Views
    1,918

    MK27 I'm not sure I quiet understand your reply...

    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...
  14. Thread: Complexity

    by spikestar
    Replies
    9
    Views
    1,918

    Complexity

    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.
  15. Replies
    3
    Views
    4,970

    I think the issue is how Im the referencing the...

    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...
  16. Replies
    3
    Views
    4,970

    Red Black Tree rotate

    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;
  17. Replies
    14
    Views
    1,494

    Just type: while(puramnt != NULL) { ...

    Just type:


    while(puramnt != NULL)
    {


    //put your code for entering data with your if statements
  18. Replies
    5
    Views
    2,164

    I'm trying to find out what is the total memory...

    I'm trying to find out what is the total memory allocated in bytes for the words being inserted.
  19. Replies
    5
    Views
    2,164

    I managed to find the time, but I cant get my...

    I managed to find the time, but I cant get my program to display "Your program size is ______ bytes". Any ideas?

    Thank in advance
  20. Replies
    5
    Views
    2,164

    i thought there is a function that can get time...

    i thought there is a function that can get time or something...gethrtime() ?????
  21. Replies
    5
    Views
    2,164

    display size and time

    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?
  22. Thread: tolower()

    by spikestar
    Replies
    1
    Views
    1,341

    tolower()

    I would just like to know how if its possible to convert tokenized words into lower case.
  23. Replies
    2
    Views
    2,770

    Binary Search Tree

    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...
  24. Replies
    5
    Views
    860

    would any one be able to give me full explanation...

    would any one be able to give me full explanation of the code and how it works? It's quiet frustrating me now ...
  25. Replies
    5
    Views
    860

    strcpy(ch, alpha); this line copies the string...

    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 ...
Results 1 to 25 of 38
Page 1 of 2 1 2