Coder Social home page Coder Social logo

tree's Introduction

Tree

by Maradona Morais

Implementações em C++ de estruturas de dados organizadas em árvore e seus algoritmos.

Features

  • Binary Tree & Binary Search Tree
    • Parte do código foi reproduzida do livro "Jumping into C++" do @alexallain
  • Heap Max
  • Heap Min (TO DO)

Complexidades

Parte do arquivo Big-O Cheat Sheet

Árvore binária

Operação Melhor caso Pior caso
Buscar O(log(n)) O(n)
Inserir O(log(n)) O(n)
Deletar O(h) O(n)

Em que n é a quantidade de elementos na árvore e h é a altura da mesma. Todos os casos médios foram O(log(n))

Heap Max

Operação Complexidade
Construir O(n)
Descer O(log(n))
Deletar O(log(n))
Subir O(log(n))
Inserir O(log(n))
Heap sort O(nlog(n))

Inserção: Insere no final e sobe.

Deleção: Substitui o último com o primeiro e desce o primeiro.

Heap sort

procedimento heapsort
    arranjar(n) // O (n)
    m <- n
    enquanto (m > 1) faça // O (n)
        troca(1, m)
        m <- m - 1
        descer(1, m) // O(log n)

tree's People

Contributors

jcert avatar mrmorais avatar

Watchers

 avatar  avatar

tree's Issues

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.