No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
7 Posted Topics
Hi, I am having a problem with an assignment for a C++ course. I have to make a Game of Life simulator (predator and prey). There are two organisms, lion and ant, and the lions eat the ants. My problem is that for some reason I can't fathom, the lions … | |
Hi all, I have written a balanced binary search tree as part of an assignment (make a simple Spell Checker). Each node has, among other values, two height ints, leftHeight and rightHeight, to keep track of the heights of any subtrees. My problem is that after a rotation, the heights … | |
Hi all, I wrote this recursive function to set the heights of each node in a search tree. It is not performing as expected; I suspect I screwed up the recursion somehow. Anyone know what the matter is? [CODE]void AVLTree::SetHeight(NodePtr &node) // root is passed in { if(node == NULL) … | |
Re: [QUOTE=vijayan121;1485965]For a dynamically allocated array with [icode]new T[N][/icode], N must be non-negative; it may evaluate to zero. When N is zero, an array with no elements is allocated and a distinct non-null pointer to it is returned. This array with no elements is deleted normally; with [icode]delete[][/icode][/QUOTE] If you read … | |
Hi all, I am tryiing to figure out how to tokenize a string consisting of words in alphabetical order, all crammed together with no delimiters. I can't for the life of me see how this could be done without analyzing the string beforehand and hard coding a delimiter in. Example … | |
Re: You need to get rid of the semi colon after the function header void write_output_data(void) Otherwise the compiler thinks it's a function declaration. | |
Hi all, I'm working on a project in my Data Structures course, using Binary Search Trees. As part of the project, we need to balance the tree. I have decided to try and make an AVL tree. I am having a problem with the rotations in particular. Somehow during the … |
The End.