Create Journals
Update Journals

Journals
Find Users
Random

Read
Search
Create New

Communities
Latest News
How to Use

Support
Privacy
T.O.S.

Legal
Username:
Password:

alison (yaylauerybunni) wrote,
@ 2003-11-19 11:35:00
Previous Entry  Add to memories!  Add to Topic Directory  Tell a Friend!  Next Entry

    I think I'll share my... 11/19 Programming Notes!! so i don't forget they're here...
    Next Monday 24: online quiz (writing methods)
    Wed Dec. 3: Exam 3 (all written)
    **************************************
    BINARY SEARCH TREES
    **************************************
    balanced - height of left tree ~= height of right tree (for all nodes; off by one)

    height - either start at level 0, or at 1. (null tree is either 0 or -1)

    traversal types
    inorder > display returns straight line
    preorder > display returns exact same tree
    postorder > display returns different tree

    // For use by countEvens()
    private int countR(Node top)
    {
    if (top == null)
    return 0;
    L = countR(top, left);
    R = countR(top, right);
    if ((top.data%2) == 0)
    return L + R + 1;
    else
    return L + R;

    -delete a leaf with 2 children by redefining the greatest left leaf (or smallest right leaf) as the subtree's new root.
    -delete a leaf with no children by pointing its parent to null.
    -delete a leaf with one child by pointing its parent to the child.

    (woo! getting out of class early!)


(Read comments)

Post a comment in response:

From:
 
Username:  Password: 
Subject:
No HTML allowed in subject
 Don't auto-format:
Message:
Enter the security code below.



Allowed HTML: <a> <abbr> <acronym> <address> <area> <b> <bdo> <big> <blockquote> <br> <caption> <center> <cite> <code> <col> <colgroup> <dd> <dd> <del> <dfn> <div> <dl> <dt> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <ins> <kbd> <li> <li> <map> <marquee> <ol> <p> <pre> <q> <s> <samp> <small> <span> <strike> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <tt> <u> <ul> <var> <xmp>
© 2002-2008. Blurty Journal. All rights reserved.