• pseudocode poetic binary search tree insert 1000 Kan it? Kanan rd, cala

    From Greg Westin@21:1/5 to All on Thu Aug 31 16:37:05 2023
    truct node {
    int val;
    node* left;
    node* right;
    };

    node* createNewNode(int x)
    {
    node* nn = new node;
    nn->val = x;
    nn->left = nullptr;
    nn->right = nullptr;

    return nn;
    }

    void bstInsert(node* &root, int x)
    {
    if(root == nullptr) {
    root = createNewNode(x);
    return;
    }

    if(x < root->val)
    {
    if(root->left == nullptr) {
    root->left = createNewNode(x);
    return;
    } else {
    bstInsert(root->left, x);
    }
    }

    if( x > root->val )
    {
    if(root->right == nullptr) {
    root->right = createNewNode(x);
    return;
    } else {
    bstInsert(root->right, x);
    }
    }
    }

    int main()
    {
    node* root = nullptr;

    int x;
    while(cin >> x) {
    bstInsert(root, x);
    }

    return 0;
    }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Westin@21:1/5 to Greg Westin on Thu Aug 31 16:44:35 2023
    On Thursday, August 31, 2023 at 4:37:08 PM UTC-7, Greg Westin wrote:
    stuct node {
    int val;
    node* left;
    node* right;
    };

    node* createNewNode(int y)
    {
    node* nn = new node;
    val = y;
    left = nullptr;
    right = nullptr;

    return nn;
    }

    void bstInsert(node* &root, int y)
    {
    if(root == nullptr) {
    root = createNewNode(y);
    return;
    }

    if(y < root->val)
    {
    if(root->left == nullptr) {
    root->left = createNewNode(y);
    return;
    } else {
    bstInsert(root->left, y);
    }
    }

    if( y > root->val )
    {
    if(root->right == nullptr) {
    root->right = createNewNode(y);
    return;
    } else {
    bstInsert(root->right, y);
    }
    }
    }

    int main()
    {
    node* root = nullptr;

    int y;
    while(cin >> y) {
    bstInsert(root, y);
    }

    return 0;
    }
    so you give the clown a ballon
    and she gives one to
    you i and you trust the clown
    to take you to the fair by microsoft

    the fair

    are you going with y
    do you have your thinking cap on
    do you see the node in the main
    and the insert method the y
    with the link aye
    we dont

    the fair

    the fair with all the companies
    the 1000 links to 1000 proteins
    in haus theyll ask as always
    and this will be there with her
    dr de root

    the fair
    and the root

    why y
    why x
    why not xy
    that would be a guy
    xx a girl
    shut up and input for God
    James 1 faith and deeds
    finish the task
    be a bioengineer
    an engineer

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Westin@21:1/5 to Greg Westin on Thu Aug 31 16:49:45 2023
    On Thursday, August 31, 2023 at 4:37:08 PM UTC-7, Greg Westin wrote:
    truct node {
    int val;
    node* left;
    node* right;
    };

    node* createNewNode(int x)
    {
    node* nn = new node;
    val = x;
    left = nullptr;
    right = nullptr;

    return nn;
    }

    void bstInsert(node* &root, int x)
    {
    if(root == nullptr) {
    root = createNewNode(x);
    return;
    }

    if(x < root->val)
    {
    if(root->left == nullptr) {
    root->left = createNewNode(x);
    return;
    } else {
    bstInsert(root->left, x);
    }
    }

    if( x > root->val )
    {
    if(root->right == nullptr) {
    root->right = createNewNode(x);
    return;
    } else {
    bstInsert(root->right, x);
    }
    }
    }

    int main()
    {
    node* root = nullptr;

    int x;
    while(cin >> x) {
    bstInsert(root, x);
    }

    return 0;
    }
    https://hupo.org/hpp-progress-to-date

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Westin@21:1/5 to Greg Westin on Thu Aug 31 16:58:08 2023
    On Thursday, August 31, 2023 at 4:49:47 PM UTC-7, Greg Westin wrote:
    On Thursday, August 31, 2023 at 4:37:08 PM UTC-7, Greg Westin wrote:
    truct node {
    string proteinname;
    string stuccoadobewillvillestanford
    node* left;
    node* right;
    };

    node* createNewNode(int x)
    {
    node* nn = new node;
    val = x;
    left = nullptr;
    right = nullptr;

    return nn;
    }

    void bstInsert(node* &root, int x)
    {
    if(root == nullptr) {
    root = createNewNode(x);
    return;
    }

    if(x < root->val)
    {
    if(root->left == nullptr) {
    root->left = createNewNode(x);
    return;
    } else {
    bstInsert(root->left, x);
    }
    }

    if( x > root->val )
    {
    if(root->right == nullptr) {
    root->right = createNewNode(x);
    return;
    } else {
    bstInsert(root->right, x);
    }
    }
    }

    int main()
    {
    node* root = nullptr;

    int x;
    while(cin >> x) {
    bstInsert(root, x);
    }

    return 0;
    }
    https://hupo.org/hpp-progress-to-date

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)