Messages - Josh [ switch to compact view ]

Pages: prev1 ... 21 22 23 24 25 [26] 27 28 29 30 31 ... 655next
Mouser, I have had problems in the past where, if I remote in on a machine with a lower desktop resolution, the icons will end up jumbled on the actual desktop when I log back in at the console. That had me puzzled at first but I figured it out. The only way around it is to use a "Icon position saving" tool and have it restore the position after you RDP in.

Personally, this reminds of when Windows XP first hit the streets and everybody swore up and down that it was a terrible, no-good OS with a horrible "kindergarten GUI". Look at it now, we can't get rid of the friggin OS. I, for one, enjoy the metro start screen (although I boot to desktop). The start screen is actually fairly intuitive and allows me to hide unnecessary clutter caused by menu after menu of new program folders. Heck, I never used the all programs menu in vista/7 with the type to search feature.

I...My wife and I must stand alone as two people who thoroughly enjoys Windows 8.1...

Coding Snacks / Re: Binary Search Tree help
« on: February 13, 2014, 09:23 AM »
mwb!!!!!! That is exactly what I had before with the exception of the fact of where I had the ++counter set at. I had it at the end of the function (made logical sense to me). Now it works beautifully!

Jibz, thanks for the suggestion as well. Unfortunately, we have to use structured code and not OOP (I love OOP and this is driving me nuts). Plus, each function I add I would have to calculate the Big-O for so I want to minimize my number of functions :)

Thanks again everyone! This is working like a champ!

Coding Snacks / Binary Search Tree help
« on: February 12, 2014, 10:35 PM »
Hello all, let me preface this by saying that YES, this is for a homework assignment. That said, I have already completed 99% of the program and the only thing left is what I am about to ask for help on.

I have a function to display a binary search tree using in-order traversal. The function works fine (as does the rest of the program, but I am having some trouble in limiting the output to 10 numbers per line.

1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30

The function looks like such

Code: C++ [Select]
  1. void inOrderDisplay(bstNode *nodeToDisplay)
  2. {
  3.         if (nodeToDisplay == NULL) return;
  4.         inOrderDisplay(nodeToDisplay->left);
  5.         cout << setw(6) << right << nodeToDisplay->integer;
  6.         inOrderDisplay(nodeToDisplay->right);  
  7. }

Now, what I am trying to achieve, as said above, is 10 numbers per line followed by a newline, then the next 10 numbers, etc.

I have tried various things like having a static int counter inside of the function, I have tried using a standard local variable, I have tried passing in the counter as a parameter (reference). Once inside, I have attempted to use (if counter == 0), if (counter % 10 == 0), or if (counter > 10).

I am really at a loss here and this is the only thing holding up my submission of this program. How do you go about doing something like this inside of a recursive function?

Thanks in advance :)

Pages: prev1 ... 21 22 23 24 25 [26] 27 28 29 30 31 ... 655next
Go to full version