HKCHaN92's Profile User Rating: -----

Reputation: 2 Apprentice
Group:
Active Members
Active Posts:
77 (0.12 per day)
Joined:
23-July 11
Profile Views:
832
Last Active:
User is offline May 07 2013 05:15 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Who Cares
Favorite Gaming Platform:
XBox
Your Car:
Mazda
Dream Kudos:
0
Icon   HKCHaN92 has not set their status

Posts I've Made

  1. In Topic: Removing Chain Rules from CFG program crashing

    Posted 30 Apr 2013

    Ok it finally works! Thank you sooo much! I just have to get rid of all the extra '|' now and hopefully that won't take too long. Thanks again!
  2. In Topic: Removing Chain Rules from CFG program crashing

    Posted 30 Apr 2013

    I've think I may have fixed it but now it's crashing at the g.GetNextItem function in FindChainRules. I'm guessing I did something wrong there I'm just having trouble figuring out what it is. It seems to crash at the end after it's done going through the list.
  3. In Topic: Binary Search Tree Zipcode Database GetItem & DeleteItem not worki

    Posted 14 Apr 2013

    View Post#define, on 14 April 2013 - 06:45 PM, said:

    Having a quick look at DeleteItem, FindNode and DeleteNode.

    At the end of DeleteNode you use the tree parameter to iterate/transverse the tree, which is problematic. When you assign the value to tree it is not pointing to the correct/original node.

      else
      {
        while (tree->right != NULL)
          tree = tree->right;
        data = tree->info;
    
        tree->info = data;
        //Delete(tree->left, data);
      }
    
    


    Thanks that helped me figure out what I was doing wrong. I was trying to use the iterative DeleteItem and PutItem functions shown in our textbook and since they were suppose to be iterative versions I thought I wouldn't need the Delete recursive function in DeleteNode anymore but I was wrong. I also did the while(tree-right != NULL) in a function called GetPredecessor and called that instead of doing it within DeleteNode and now it works. Thanks so much for your help and patience jim and especially #define.
  4. In Topic: Binary Search Tree Zipcode Database GetItem & DeleteItem not worki

    Posted 14 Apr 2013

    View Post#define, on 14 April 2013 - 05:38 PM, said:

    The item is returned using the reference parameter :

    Retrieve(TreeNode<T>* tree, T& item, bool& found)
    
    


    So follow the function hierarchy and item back to main.


    Ok so I changed the item in GetItem to a reference variable as well (hopefully that's what you meant) and now when you choose the find option it finds the Zipcode object that goes with the zipcode entered by the user and prints that zipcode as well as the city and state that go with it but it didn't fix the problem with the delete option where I delete something and then use the list option and instead of 9 Zipcode objects it lists just the 4 listed in my last post.
  5. In Topic: Binary Search Tree Zipcode Database GetItem & DeleteItem not worki

    Posted 14 Apr 2013

    View Post#define, on 14 April 2013 - 04:12 PM, said:

    You changed the operator>? What does it look like?

    Did you look at the other operator< as well?


    Now I have and this is what they look like:
    bool operator> (const Zipcode &z1, const Zipcode &z2)
    
    {
    	string zip1 = z1.GetZip();
    	string zip2 = z2.GetZip();
    	
    	if (zip1 > zip2)
    		return true;
    	else
    		return false;
    }
    
    bool operator< (const Zipcode &z1, const Zipcode &z2)
    {
    	string zip1 = z1.GetZip();
    	string zip2 = z2.GetZip();
    
    	if (zip1 < zip2)
    		return true;
    	else 
    		return false;
    }
    
    


    It prints the list in the right order now and it says the record is found but it doesn't seem to print the city and state info that matches that zipcode when trying the find option. And now after I delete an item it does delete it from the tree but when I list the tree again afterwards only 4 are left when there should be 9. I delete the zipcode 89039 and only these were printed in the list after the deletion:
    12016
    Auriesville
    NY
    15329
    Prosperity
    PA
    28787
    Weaverville
    NC
    91103
    Pasadena
    CA

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Interests:
Anime, Video Games (mainly RPGs and MMORPGs), Manga, Young Adult Novels (supernatural ones like House of Night, Fallen Series, Mortal Instruments and Clockwork Angel Series, Cirque Du Freak, ect), Movies (action adventure, superhero films, films based on books I've read as long as they don't suck, some romantic comedies, some drama depending, some romance, and some foreign, and some classics), into several different TV shows, and of course I'm interested in programming...but I'm still really new at it and my community college only offers online classes in programming which makes learning it even harder.
Programming Languages:
C++

Contact Information

E-mail:
Private

Friends

Comments

HKCHaN92 has no profile comments yet. Why not say hello?