# Search:

Type: Posts; User: std10093

Page 1 of 20 1

1. ## Thread: memory complexity of std::sort

by std10093
Replies
10
Views
3,236

### The complexity given is not even time, but...

The complexity given is not even time, but numbers of comparisons.

@rcgldr, I would agree.
2. ## Thread: memory complexity of std::sort

by std10093
Replies
10
Views
3,236

### Thanks Soma! Jim, isn't that the time complexity?...

Thanks Soma! Jim, isn't that the time complexity? I am interested in the memory complexity!
3. ## Thread: memory complexity of std::sort

by std10093
Replies
10
Views
3,236

### memory complexity of std::sort

What's the memory complexity of std::sort? I assume O(n), but I can't find any ref for it!

Also, do I understand the term memory complexity correctly? I understand it as how much memory the...
4. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### The version you posted matches the other...

The version you posted matches the other attempts. The most difficult part for me was GAP C, because the thread agrees that it needs two commands, an assignment and a return and somehow I felt that a...
5. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### I checked the first piece of code you have. I see...

I checked the first piece of code you have. I see only the different order in the last return and not an extra assignment....oh, I now saw that I hadn't let you know that I had that extra assignment...
6. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### No I am not saying you are crazy! I see your...

No I am not saying you are crazy! I see your point. So, can you present your version of the function to take a look at it?
7. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### I tested it it seems OK. Moreover, we want the...

I tested it it seems OK. Moreover, we want the right child to be more than the parent and the left child to be less, so I feel I am on the right track.
8. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### I don't see what you changed, sorry. I mean, line...

I don't see what you changed, sorry. I mean, line 9 from my attempt is pretty similar to yours.

EDIT

I could keep my last attemt and change the last return with this:

return...
9. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### The last attempt is wrong. It doesn't check the...

The last attempt is wrong. It doesn't check the values in a perfect tree. For example,

4
2 6
1 8 5 7
will be considered sorted, and it is not!
10. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### That's what I am saying! I think something...

That's what I am saying!

I think something like this should work:

int fun(Treeptr p, int * ap, int * bp) {
int a, b;
if (p->left == NULL && p->right == NULL) {
*ap = p->value;
11. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### After more testing, it seems that the first...

After more testing, it seems that the first solution is wrong too. I am now working on the second one however.
12. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### Yes, the first solutions works. I use this...

Yes, the first solutions works. I use this code, modified to host an integer and not a word.
13. ## Thread: Function to determine if a tree is sorted (i.e. BST)

by std10093
Replies
16
Views
1,523

### Function to determine if a tree is sorted (i.e. BST)

I used this code to perform this kind of operation.

int BST(Treeptr p, int MIN, int MAX);

int ordtree_old(Treeptr p) {
/* BST = Binary Search Tree.
* You can name your function as...

by std10093
Replies
9
Views
1,091

### Thanks for the information!

Thanks for the information!

by std10093
Replies
9
Views
1,091

### Ok I see. I will have to read the theory behind...

Ok I see. I will have to read the theory behind the weaker memory order, but I got the big picture.

However, in this problem it would be more reasonable to let the threads run (without...

by std10093
Replies
9
Views
1,091

### A variable visible to all threads

I want to write a program where, random numbers are going to be created and I am going to track down the greatest of them. Three threads are going to run in parallel.

I do it with two methods....
17. ## Thread: Sorted binary tree

by std10093
Replies
6
Views
782

### Yes I agree. My question however is how the tree...

Yes I agree. My question however is how the tree I posted in the picture would be sorted. I mean let's say that we erase the values and we place them as we want in the picture, in which way should we...
18. ## Thread: Sorted binary tree

by std10093
Replies
6
Views
782

### So my worries were correct. Thanks. However,...

So my worries were correct. Thanks.

However, another question just got in my mind. With this structure of the tree, how would we place the values (1 till 7), so that the tree would be ordered?
19. ## Thread: Sorted binary tree

by std10093
Replies
6
Views
782

### Sorted binary tree

I saw an example of a binary tree and I am wondering if it's sorted or not.

13654

I am dangled with the all nodes thing the link says.
20. ## Thread: Providing my own simple iterators

by std10093
Replies
40
Views
1,949

### What? Did I act like knowing better? :P Moreover,...

What? Did I act like knowing better? :P Moreover, it's not for homework. Anyway, these kind of discussions destroy the archive concept.
21. ## Thread: Providing my own simple iterators

by std10093
Replies
40
Views
1,949

### The dimension is an argument of the constructor....

The dimension is an argument of the constructor.

:O
I know saw Soma's post. Where did I say I am good in C++? I am learning.
22. ## Thread: Providing my own simple iterators

by std10093
Replies
40
Views
1,949

### The Point can have as many coordinates as the...

The Point can have as many coordinates as the user wants. Thanks for the all the answers, but I accomplished what I was asked too.
23. ## Thread: Providing my own simple iterators

by std10093
Replies
40
Views
1,949

### And what GetCoordinates return? Maybe a pointer...

And what GetCoordinates return? Maybe a pointer to the vector of coordinates?
24. ## Thread: Visual C++ starter guide?

by std10093
Replies
9
Views
797

### Take into account that because you probably use...

Take into account that because you probably use Visual Studio, this dosn't mean you shall learn Visual C++.
C++ is a programming langugae.
Visual studio is an IDE, an editor to write and run your...
25. ## Thread: C++ or C#?

by std10093
Replies
52
Views
3,450

### C++ I would say is the way to go then.

C++ I would say is the way to go then.
Results 1 to 25 of 500
Page 1 of 20 1