Search:

Type: Posts; User: cfan

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,368

    i tried to understand using this ***R*** but i...

    i tried to understand using this ***R***
    but i cant see to what side left or right


    build( arr + start, end - start );


    it refers too?

    because if start if 0 at the begginig then our...
  2. Replies
    5
    Views
    1,368

    recriating a bst tree from inorder

    i have an inorder traversal array (in every node we have only two sons or no sons)
    and i need to construct a BST tree out of it.
    if i had freedom i would do a fuction of node build(arr,start,end)...
  3. Replies
    4
    Views
    1,993

    i think the answer is searching the first node...

    i think the answer is searching the first node whoch is larger then arr[i]

    is it ok?
  4. Replies
    4
    Views
    1,993

    its not 2i but i+1 i got to that conclution...

    its not 2i but i+1

    i got to that conclution too

    but the right son is hard
    because if a tree is not simetric and somewhere we dont have a left of right node
    then we cant break it into two
  5. Replies
    4
    Views
    1,993

    recriating a bst tree from preorder

    i have an array of the pre order traversal
    and i know that the root it arr[0]
    and its left son is arr[1]

    whats the formula for spotting the value of its right son value

    ??
  6. Replies
    2
    Views
    1,675

    what is the algorithm in this problem..

    i need to write a recursive function which finds the smallest number in a tree which is bigger
    then the given number

    ??
  7. each combination of chars in every length

    each combination of chars in every length
  8. or is "the" a substring of "beach towel" since...

    or is "the" a substring of "beach towel" since all the letters are there somewhere?

    yes
  9. i dont want you to solve it for me. i want to...

    i dont want you to solve it for me.
    i want to understand the general way
    how to play whic a string in order to get every combination
    in iterative way
    ??
  10. the problem is that i have the code of recursive...

    the problem is that i have the code of recursive subsets
    but i dont andestand it at all.

    could you tell me the general iterative index way of generating each string.
  11. Replies
    0
    Views
    1,568

    data mamgment problem (algorithm)

    this is the original question:
    "there are stations all over the country which measure the temperature and the
    amount of rain fallen every day of the week.
    each station writes in a weekly report...
  12. the easyiest way of finding all the combinations of a string..

    i have a recursive subset code
    but its way too long to remember

    is there some easier iterative algorithm to generate all the sub string of a given string

    ?
  13. Replies
    10
    Views
    5,378

    template bool...

    template <typename ElemType>
    bool BST<ElemType>::remove(ElemType data) {
    return recRemoveNode(root, data);
    }
    template <typename ElemType>
    bool BST<ElemType>::recRemoveNode(nodeT *& t,...
  14. Replies
    10
    Views
    5,378

    correct me if i am wrong balanced means that...

    correct me if i am wrong
    balanced means that height of the left subtree minus height of the right tree
    is less then two.

    so thats not what i am looking for

    so i will use whiteflags method:
    ...
  15. Replies
    10
    Views
    5,378

    are you sure that avl is my answer because i am...

    are you sure that avl is my answer
    because i am ask to act on pure BST
    not self balancing bst trees
  16. Replies
    10
    Views
    5,378

    can you specify what algorithm is for me? i...

    can you specify what algorithm is for me?

    i looked it threw
    and it talks only about avl trees
    not bst
    although avl is a self balancing bst

    and there is no recursive node removal

    ??
  17. Replies
    10
    Views
    5,378

    i have some corrections to the original question:...

    i have some corrections to the original question:
    the node to be deleted is not te root
    it has only one son or no sons.

    regarding whiteflags post:
    if i free the wanted node i need to rearrange...
  18. Replies
    10
    Views
    5,378

    deleting a node in a recursive way algorithm..

    after solving the previus one with the root.
    i looked in
    Eternally Confuzzled - Binary Search Trees I
    but i coudnt see the general algorithm for
    deleting a node in a BST tree in a recursive way...
  19. Replies
    18
    Views
    1,851

    node* delete (node*root) { node*...

    node* delete (node*root)
    {
    node* prev,*temp;
    if (!root) return NULL;
    if (!(root->left)
    {
    temp=root->right;
    free(root); //i am not sure its legal because its a...
  20. Replies
    18
    Views
    1,851

    no i think ill just copy the value 5 in the root...

    no i think ill just copy the value 5 in the root
    and make the right some of 4 to be 4.5
    and free the leaf copy of 5

    ok?
  21. Replies
    18
    Views
    1,851

    ok you are correct not -1 but 4.5 what do i...

    ok you are correct not -1
    but 4.5


    what do i do if 5 has a left son 4.5


    6
    / \
    4 7
  22. Replies
    18
    Views
    1,851

    thats a direct quote from the text so its not me....

    thats a direct quote from the text so its not me.
    5 could have a left child -1 and its still be the predeccesor

    my question is what do i do with this 8
    or if i had a -1 as the left son of 5...
  23. Replies
    18
    Views
    1,851

    for one child or no child: If the node has a...

    for one child or no child:
    If the node has a left child, replace it with the left child.
    If the node has a right child, this is the symmetric case for if the node has a left child.
    If the node has...
  24. Replies
    18
    Views
    1,851

    i have been given this assignment by my teacher...

    i have been given this assignment by my teacher
    of course i will go to him with this problem.

    but there has to be a basic algorithm for this
  25. Replies
    18
    Views
    1,851

    so there is no general algorithm?

    so there is no general algorithm?
Results 1 to 25 of 46
Page 1 of 2 1 2