Giter VIP home page Giter VIP logo

codec_abtest's Introduction

How would you describe ...

  • Linked Lists

A structure where each element has at least two parts

  • Parts
      1. the value of the element
      1. The link (also know as a pointer) which
      • either points to the next element,
      • or points to an indicator for the end of the list (e.g NULL)
  • Extra
    • Since each list element points to the next, a linked list doesn't need sequential memory space.
    • Retrieving any but the first item in the list, requires traversing the list from the beginning, to find that item.

  • Stacks

Work exactly how they sound: You can only add (push) items to the "top" (end) of the stack. You only remove (pop) items from top (end) of the stack.

  • Properties
    • Newly added items are dealt with first: called Last-In-First-Out order.
    • To get to the oldest items (items that were pushed first), you must remove one by one, from the top of the stack.
    • The pointer always points the most recent item in the stack.

  • Hash Maps

Match or map a key, like "Elon_Musk"; to a value, like "Tesla".

####A hash map is like a sandwich. Between the key and value, is the hash-value/hash function. Every key-value pair, has its own hash between it.

  • Ideal situation
    • Every key maps to exactly one value.
    • Keys in the hash map are unique.
  • Example (Python)
    • {"Elon_Musk": "Tesla", "Steve_Ballmer" : "Microsoft", "Satya_Nadella": "Microsoft"}
  • Extra
    • A hash function may not provide a unique value for every key.
    • A value is accessed/retrieved by its key.

  • Trees

A nested structure, where each element/node has two parts

  • Parts
      1. the value of the node
      1. the branches - links to subsequent nodes
  • Properties
      1. Every node has a fixed, maximum number of branches.
      1. The node that is not a branch, is the root node.
      1. Branches nodes are "children" of their parent node.
      1. Any search for any value starts at the root node.
  • Example
    • In a binary tree, nodes can have a max of 2 branches.

  • Heaps

A Tree where the value of every parent node is the maximum or minimum of all of child nodes (and their children, etc.) connected to that parent.

  • Examples
    • Max value heap: A parent node has value 255. Its child nodes must have values 255 or less. Parent holds the max value.
    • Min value heap: A parent node has value 255. Its child nodes must have values 255 or more. Parent holds the min value.
    • The "greater/less than or equal to" rule, applies to every node, not just the parent.

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.