Code Monkey home page Code Monkey logo

ls-data-structures's Introduction

Data Structures I

Topics:

  • Big-O Notation (Complexity analysis)
  • Stacks
  • Queues
  • Linked Lists
  • Hash Tables

Stacks

  • Should have the methods: add, remove, and a getter for the property size
  • add should accept a value and place it on top of the stack.
  • remove should remove and return the top value off of the stack.
  • size should return how many items are on the stack.

Queues

  • Should have the methods: enqueue, dequeue, and a getter for the property size
  • enqueue should add an item to the back of the queue.
  • dequeue should remove an item from the front of the queue.
  • size should return the number of items in the queue.

Linked Lists

  • Should have the methods: addToTail, removeHead, and contains.
  • addToTail replaces the tail with a new value that is passed in.
  • removeHead removes and returns the head node.
  • contains should searth through the linked list and return true if a matching value is found.
  • The head property is a reference to the first node and the tail property is a reference to the last node. These are the only two properties that you need to keep track of an infinite number of nodes. Build your nodes with objects.

Hash Tables

  • Should have the methods: insert, remove, and retrieve.
  • insert should take a key value pair and add the value to the hash table.
  • retrieve should return the value associated with a key.
  • remove should removed the given key's value from the hash table.
  • Should properly handle collisions. If two keys map to the same index in the storage table then you should store a 2d array as the value. Make each key/value pair its own array that is nested inside of the array stored at that index on the table.

Extra Credit

  • Uncomment the final test in hash-table.test.js and make the hash-table rebalance. As a hash table increases in size the associated storage table will typically double in size once it reaches a certain capacity. Change the hash table so that it doubles the size of the storage table once it is 75% full.
  • Make the linked-list a doubly linked list.

ls-data-structures's People

Watchers

 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.