Search Results - CodeGuru Forums
 CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Bassman

Page 1 of 3 1

1. Thread: Is it wrong to say that a binary tree does not require a separate sort?

by Bassman
Replies
10
Views
631

Sam, What definition of sort makes this...

Sam,

What definition of sort makes this correct (and the poster you replied to incorrect) and what is your justification for the definition? Specifically, why does your definition vary from...
2. Thread: Is it wrong to say that a binary tree does not require a separate sort?

by Bassman
Replies
10
Views
631

You probably should....

You probably should.
(Binary tree sort)

Regards,
Bassman
3. Thread: Is it wrong to say that a binary tree does not require a separate sort?

by Bassman
Replies
10
Views
631

Also, Sam, I should point out that my main issue...

Also, Sam, I should point out that my main issue here is simply that:

Building a binary/AVL tree == Sorting an unsorted array == O(n log n)

So the act of arranging the items in a logical order...
4. Thread: Is it wrong to say that a binary tree does not require a separate sort?

by Bassman
Replies
10
Views
631

If you consider it so insignificant, why are you...

If you consider it so insignificant, why are you taking the trouble to post it to a new thread?

What in particular is the specific problem with saying that inserting a group of items into a binary...
5. Thread: Printing the array elements in order without sorting????

by Bassman
Replies
28
Views
1,491

And my point was that a 'separate sort' and...

And my point was that a 'separate sort' and 'building a sorted list' are algorithmically and functionally equivalent. Both perform a sort operation.

So it's correct to say that data can not be...
6. Thread: Printing the array elements in order without sorting????

by Bassman
Replies
28
Views
1,491

To sort - to arrange; to put into a specific...

To sort - to arrange; to put into a specific order or relation.

You disagree on this definition? Why impede communication with your peers by making up your own definition of words? That's awfully...
7. Thread: Printing the array elements in order without sorting????

by Bassman
Replies
28
Views
1,491

I disagree. Data must be explicitly sorted to be...

I disagree. Data must be explicitly sorted to be displayed in a conceptual 'order'.

Inserting a group of items into a binary tree explicitly sorts the items.

The sort is just distributed over n...
8. Thread: Whats wrong with my code?

by Bassman
Replies
17
Views
984

Oh, of course nobody wants this to turn into a...

Oh, of course nobody wants this to turn into a 'witch-hunt,' as you so eloquently put it. There's nothing to hunt - it's completely obvious you were being a doofus.

Sarcasm
{
Thank you so much...

by Bassman
Replies
12
Views
2,369

Like anything else, the use of exceptions is...

Like anything else, the use of exceptions is fraught with debate and it's closer to a religious argument than it is to an objective cost-benefit analysis.

by Bassman
Replies
12
Views
2,369

My two cents: I used to do this, but now I...

My two cents: I used to do this, but now I generally don't like to do this, because it breaks the RAII idiom that I've grown so fond of. Not only that, but it's almost always unneccesary.
...
11. Thread: pointer to pointer to heap

by Bassman
Replies
5
Views
514

No, as long as you call pA1 = pA2->m_pA1;...

No, as long as you call

pA1 = pA2->m_pA1;

before
12. Thread: pointer to pointer to heap

by Bassman
Replies
5
Views
514

Not neccessarily true. Dereferencing pa2 will...

Not neccessarily true.

Dereferencing pa2 will naturally fail, but:

classA1* pA1 = pA2->m_pA1;
delete pA2;
pA1->DoSomething();

by Bassman
Replies
8
Views
651

Hmmm.... when I wrote that, I disremembered...

Hmmm.... when I wrote that, I disremembered myself into thinking that the structure only pads the end of the structure to stay aligned, but of course you're right - there's no guarantees.

And like...

by Bassman
Replies
8
Views
651

No, you could do a really ugly trick. char...

No, you could do a really ugly trick.

char *pString = "12345612345678123412";
myStruct* pStruct = reinterpret_cast<myStruct*>(pString);

Then use pStruct->sFirstParam, etc.

However,...

by Bassman
Replies
3
Views
476

Inside Philip's loop T item = *it;

Inside Philip's loop

T item = *it;
16. Thread: Problems converting a string to a Uint16

by Bassman
Replies
3
Views
3,174

Just to beat the dead horse, (111111111 %...

Just to beat the dead horse,

(111111111 % 65536) = 27591

so your code is correct to the precision of an unsigned 16-bit integer. Like Phillip said, if you want more than 65535, you should use...

by Bassman
Replies
5
Views
537

Before you start researching implementation...

Before you start researching implementation techniques, you need to know exactly what it is going to do, and exactly how you want people to use it. Otherwise, you're just yelling in the wind.

Is...

by Bassman
Replies
5
Views
1,077

I know for certain that many compilers will...

I know for certain that many compilers will optimize tail recursion into an iterative solution.

(Briefly) Tail recursion means that there are no operations after the recursive call - and that kind...
19. Thread: how to implement linked list without using pointer in C

by Bassman
Replies
8
Views
2,799

Your question is strange... As has been pointed...

Your question is strange... As has been pointed out, a linked list by definition uses pointers - so what is it exactly that you're trying to accomplish and why?

Regards,
Bassman
20. Thread: Is there a problem using malloc and new together?

by Bassman
Replies
6
Views
931

Just to add to the discussion, grp = new...

Just to add to the discussion,

grp = new char [sizeof (penv) + 1];

makes me think you really want to do:

grp = new char [strlen(penv) + 1];

by Bassman
Replies
40
Views
3,577

Yeah, sorry, my fault - I shouldn't be such a...

Yeah, sorry, my fault - I shouldn't be such a boob. Like I said, I'm grumpy today. Stupid COM objects...

:)

Peace,
Bassman

by Bassman
Replies
40
Views
3,577

Doctor Luz said: ... and later ... ...

Doctor Luz said:

... and later ...

(flip/flop)

by Bassman
Replies
40
Views
3,577

(Taking the piss) What's there to argue about? ...

(Taking the piss) What's there to argue about?

n! is defined as Gamma(n + 1) for all complex numbers > 0. For positive integers, n! is also defined as n * n-1 * n-2 * ... * 3 * 2.

And BTW, you...

by Bassman
Replies
40
Views
3,577

I thought he was full of s*, too (no offense,...

I thought he was full of s*, too (no offense, man), so I googled and found,

http://mathworld.wolfram.com/Factorial.html

Check out (7).

AAAIAIAIAGH!!! INTEGRALS SCARY!!!! AIGH!!

Peace,...
25. Thread: need some recursion help

by Bassman
Replies
6
Views
637

No, I meant just the printing code - like this: ...

No, I meant just the printing code - like this:

void triangle(ostream& outs, int m, int n){
int i;

for(i=0;i<m;i++)
outs << "*";
cout << endl;
Results 1 to 25 of 59
Page 1 of 3 1