GithubHelp home page GithubHelp logo

samuelbanya / phase-4-data-structures-implement-singly-linked-list Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-curriculum/phase-4-data-structures-implement-singly-linked-list

0.0 0.0 0.0 11 KB

License: Other

Ruby 100.00%

phase-4-data-structures-implement-singly-linked-list's Introduction

Singly Linked List Methods Lab

Learning Goals

  • Build out common methods for a Singly Linked List

Introduction

In the previous lesson, you learned what a Singly Linked List is and we built out the initial LinkedList and Node classes, as well as learned how to append on to a linked list. We also learned how to add to our Singly Linked List. In this lab, let's build out some more of the common methods we might need when using a Singly Linked List.

Fork and clone this lab; you'll be coding in the lib folder. You can run the tests at any point using learn test to check your work.

Instructions

Start by building out the LinkedList class.

Once you have the first test passing, build out the following methods:

  • LinkedList#prepend(node): adds a node to the beginning of the list (the head)
  • LinkedList#append(node): adds a node to the end of the list (feel free to reuse/modify the code from the previous lesson)
  • LinkedList#delete_head: delete the head node
  • LinkedList#delete_tail: removes the node at the end of the list
  • LinkedList#add_after(index, node): adds a node after the given index of the linked list
  • LinkedList#search(value): finds a node with the given value within the list

phase-4-data-structures-implement-singly-linked-list's People

Contributors

graciemcguire avatar alveem avatar ihollander avatar samuelbanya 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.