GithubHelp home page GithubHelp logo

leetcode_algorithm's Introduction

LeetCode_algorithm

About the Tree: full binary tree: A binary tree in which each node has exactly zero or two children. Perfect binary tree: A binary tree with all leaf nodes at the same depth. All internal nodes have degree 2 [1]

The difference between Full Binary Tree & Complete Binary Tree: (1). a binary tree T is full if each node is either a leaf or possesses exactly two child nodes. (2). a binary tree T with n levels is complete if all levels except possibly the last are completely full, and the last level has all its nodes to the left side. [2]

AVL Trees: AVL trees are self-balancing binary search trees. These trees are named after their two inventors G.M. Adel’son-Vel’skii and E.M. Landis. [3]

The height/depth of a tree: The height of a node is the length of the longest downward path to a leaf from that node. The height of the root is the height of the tree. The depth of a node is the length of the path to its root (i.e., its root path). This is commonly needed in the manipulation of the various self-balancing trees, AVL Trees in particular. The root node has depth zero, leaf nodes have height zero, and a tree with only a single node (hence both a root and leaf) has depth and height zero. Conventionally, an empty tree (tree with no nodes, if such are allowed) has depth and height −1.[4]

REF: [1] http://xlinux.nist.gov/dads//HTML/perfectBinaryTree.html [2] http://courses.cs.vt.edu/~cs3114/Fall09/wmcquain/Notes/T03a.BinaryTreeTheorems. [3] http://courses.csail.mit.edu/6.006/fall09/lecture_notes/lecture04.pdf [4] http://www.cs.cmu.edu/~adamchik/15-121/lectures/Trees/trees.html

leetcode_algorithm's People

Contributors

yuzhangcmu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.