Giter Site home page Giter Site logo

algorithms-heap-web-0615-public's Introduction

Algorithms Heap

A heap is a data structure that is a type of tree. According to Wikipedia, a data structure is said to be a heap if it satisfies the following "heap property":

If A is a parent node of B then the key of node A is ordered with respect to the key of node B with the same ordering applying across the heap. (See the diagram below.)

Heaps make it easy to access the highest or lowest value element in a set of data (always keeping it at the "top" of the heap). A max heap always keeps the maximum element at the root node (the topmost node), and a min heap always keeps the minimum element at the root.

An example of a min heap, heap, which shows how the heap changes when the push method is called: Min Heap

Instructions

For this lab, you will implement a MinHeap class that stores data and always keeps track of its minimum element as its root. It will have a push method as illustrated by the above diagram, as well as a pop method that ensures the minimum element will always be stored in the root.

Run rspec --fail-fast and make the tests pass one at a time.

Resources

algorithms-heap-web-0615-public's People

Contributors

roseweixel avatar aviflombaum avatar fislabstest avatar arpradhan avatar fs-lms-test-bot avatar

Watchers

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