Code Monkey home page Code Monkey logo

listapi's Introduction

#List API seed

Linked lists are a very basic data structure that form the cornerstone of many data structures in common use on the Internet today. In this exercise, you will be filling out an existing API in order to get all the test cases to pass.

The test cases can be run in your browser. Follow the instructions below to get going:

  • Fork this repo and clone it to your machine
  • Open the file called test-setup.html in your browser.
  • Open the list.js and list-test.js files in a text editor.
  • Refresh your browser each time you make (and save) a change to see how your code passes tests
  • When the tests go green, you are done!

The API allows basic manipulation of a singly linked list. For example:

  var l = new List()
  l.add("a")
  l.add("b")
  l.add("c")
  var d = l.pop()              // d === "c"
  var h = l.head()             // h === "b"
  var len = list.length()      // len === 2

The idea of this exercise is to first understand how the list works by reading the code. We store the list as a a linked list if Item() types wrapped in a List() object and work from there. Each function that you need to implement has been declared for you and the comments above each one should tell you what that function is supposed to do. We will also go through the API in class.

listapi's People

Contributors

davidmweber avatar

Watchers

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