GithubHelp home page GithubHelp logo

algorithm_module's Introduction

title: this is the algorithm patter

use algorithm with me!

step 1 patter : Binary tree, Linked list,Stack, Queue and Binary step 2 leetcode part Q&A


  • step 1

    1. Binary tree

    2. Linked list

    3. Stack and queue

    4. Binary

  • step 2

    1. leetcode question

Install

go get github.com/CaiNiaoHui/algorithm_module

import (
	tree "github.com/CaiNiaoHui/algorithm_module/binary_tree/package"

) 

how to use

tree function use

  1. create tree

    tree := &_package.TreeNode{Value: 0, Left: nil, Right: nil}
    
  2. Preorder traversal

    _package.Preorder_recursion(tree)
    
  3. Non-recursive preorder traversal

    result := _package.Preorder_non_recursive(tree)
    
  4. Midorder traversal

    _package.Inorder_recursion(tree)
    
  5. Non-recursive Midorder traversal

    result = _package.Inorder_non_recursive(tree)
    
  6. Postorder traversal

    _package.Postorder_recursion(tree)
    
  7. Non-recursive Postorder traversal

    result = _package.Postorder_non_recursive(tree)
    
  8. dfs traversal tree (up to down)

    result = _package.Dfs_upTodown(tree)
    
  9. dfs divide and conquer traversing the tree (down to up)

    result = _package.Dfs_downToUp(tree)
    
  10. bfs sequence traversal

    result1 := _package.Bfs_levelOrder(tree)
    
  11. Merge sort

    result = _package.MergeSort(arr)
    
  12. Quick sort

    _ = _package.QuickSort(arr1)
    
  13. tree Maximum depth

    depth := _package.MaxDepth(tree)
    
  14. detect balanced binary tree

    depth = _package.IsBalaced(tree)
    
  15. travel max path

    maxpath := _package.MaxPathSum(tree)
    
  16. bfs sequence traversal (up to down)

    result1 = _package.Bfs_Traverse(tree)
    
  17. bfs sequence traversal (down to up)

    result1 = _package.Bfs_Traverse_reverse(tree)
    
  18. bfs sequence traversal ('Z' glyph traversal)

    result1 = _package.Bfs_Traverse_Z(tree)
    
  19. Judging the binary search tree

    tr := _package.Is_BST(tree)
    

algorithm_module's People

Contributors

learnmakenote avatar cainiaohui avatar

Watchers

James Cloos avatar  avatar  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.