Search:

Type: Posts; User: std10093

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    10
    Views
    7,802

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

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

    @rcgldr, I would agree.
  2. Replies
    10
    Views
    7,802

    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. Replies
    10
    Views
    7,802

    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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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...
  14. Replies
    9
    Views
    1,770

    Thanks for the information!

    Thanks for the information!
  15. Replies
    9
    Views
    1,770

    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...
  16. Replies
    9
    Views
    1,770

    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. Replies
    6
    Views
    1,143

    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. Replies
    6
    Views
    1,143

    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. Replies
    6
    Views
    1,143

    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. Replies
    40
    Views
    2,944

    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. Replies
    40
    Views
    2,944

    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. Replies
    40
    Views
    2,944

    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. Replies
    40
    Views
    2,944

    And what GetCoordinates return? Maybe a pointer...

    And what GetCoordinates return? Maybe a pointer to the vector of coordinates?
  24. Replies
    9
    Views
    1,059

    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
    4,611

    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 2 3 4