Click here to Skip to main content
15,877,103 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionuse custom icon on an AfxMessageBox Pin
b-rad31126-Mar-10 6:29
b-rad31126-Mar-10 6:29 
AnswerRe: use custom icon on an AfxMessageBox Pin
jeron126-Mar-10 7:03
jeron126-Mar-10 7:03 
GeneralRe: use custom icon on an AfxMessageBox Pin
b-rad31126-Mar-10 8:18
b-rad31126-Mar-10 8:18 
QuestionHelp with binary tree(BST) function building. Pin
Member 382253226-Mar-10 4:52
Member 382253226-Mar-10 4:52 
AnswerRe: Help with binary tree(BST) function building. Pin
David Crow26-Mar-10 5:28
David Crow26-Mar-10 5:28 
GeneralRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 6:45
Member 382253226-Mar-10 6:45 
GeneralRe: Help with binary tree(BST) function building. Pin
David Crow26-Mar-10 7:35
David Crow26-Mar-10 7:35 
AnswerRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 8:03
Member 382253226-Mar-10 8:03 
Yes I thought so too, that I had to "friend" the BST class.
But my instructions are to implement the function in main.

here's the insert function in bst.cpp:

void BinarySearchTree::searchTreeInsert(const TreeItemType& newItem)
   throw(TreeException)
{
   insertItem(root, newItem);
}  // end searchTreeInsert


^^That function calls this function below(still in bst.cpp):

void BinarySearchTree::insertItem(TreeNode *& treePtr,
				  const TreeItemType& newItem)
   throw(TreeException)
{
   if (treePtr == NULL)
   {  // position of insertion found; insert after leaf

      // create a new node
      try
      {
	 treePtr = new TreeNode(newItem, NULL, NULL);
      }
      catch (bad_alloc e)
      {
	 throw TreeException(
	 "TreeException: insertItem cannot allocate memory");
      }  // end try
   }
   // else search for the insertion position
   else if (newItem.getKey() < treePtr->item.getKey())
      // search the left subtree
      insertItem(treePtr->leftChildPtr, newItem);

   else  // search the right subtree
      insertItem(treePtr->rightChildPtr, newItem);
}  // end insertItem

GeneralRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 8:09
Member 382253226-Mar-10 8:09 
GeneralRe: Help with binary tree(BST) function building. Pin
David Crow26-Mar-10 8:11
David Crow26-Mar-10 8:11 
GeneralRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 8:24
Member 382253226-Mar-10 8:24 
QuestionRe: Help with binary tree(BST) function building. Pin
David Crow26-Mar-10 8:36
David Crow26-Mar-10 8:36 
AnswerRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 8:55
Member 382253226-Mar-10 8:55 
AnswerRe: Help with binary tree(BST) function building. Pin
David Crow26-Mar-10 8:58
David Crow26-Mar-10 8:58 
GeneralRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 9:15
Member 382253226-Mar-10 9:15 
GeneralRe: Help with binary tree(BST) function building. Pin
David Crow26-Mar-10 9:29
David Crow26-Mar-10 9:29 
GeneralRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 9:34
Member 382253226-Mar-10 9:34 
GeneralRe: Help with binary tree(BST) function building. Pin
David Crow26-Mar-10 9:36
David Crow26-Mar-10 9:36 
GeneralRe: Help with binary tree(BST) function building. Pin
Member 382253226-Mar-10 9:44
Member 382253226-Mar-10 9:44 
Questionfatal error c1083 in C# Pin
sindhumahe26-Mar-10 4:13
sindhumahe26-Mar-10 4:13 
AnswerRe: fatal error c1083 in C# Pin
Chris Losinger26-Mar-10 4:17
professionalChris Losinger26-Mar-10 4:17 
QuestionButton Caption Pin
shiv@nand26-Mar-10 3:13
shiv@nand26-Mar-10 3:13 
AnswerRe: Button Caption Pin
CPallini26-Mar-10 3:21
mveCPallini26-Mar-10 3:21 
GeneralRe: Button Caption Pin
shiv@nand26-Mar-10 3:31
shiv@nand26-Mar-10 3:31 
GeneralRe: Button Caption Pin
CPallini26-Mar-10 3:39
mveCPallini26-Mar-10 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.