Giter VIP home page Giter VIP logo

data-structures-and-algorithms-401's Introduction

Data Structures and Algorithms

See setup instructions, in the Code 301 Setup Guide.

Repository Quick Tour and Usage

301 Code Challenges

Under the data-structures-and-algorithms repository, at the top level is a folder called code-challenges

Each day, you'll add one new file to this folder to do your work for the day's assigned code challenge

401 Data Structures, Code Challenges

  • Please follow the instructions specific to your 401 language, which can be found in the directory below, matching your course.

Singly Linked List

Implementation: Singly Linked Lists

Challenge

  • Create a Node class that has properties for the value stored in the Node, and a pointer to the next Node.
  • Within your LinkedList class, include a head property. Upon instantiation, an empty Linked List should be created.
    • Define a method called insert which takes any value as an argument and adds a new node with that value to the head of the list with an O(1) Time performance.
    • Define a method called includes which takes any value as an argument and returns a boolean result depending on whether that value exists as a Node’s value somewhere within the list.
    • Define a method called toString (or str in Python) which takes in no arguments and returns a string representing all the values in the Linked List, formatted as: "{ a } -> { b } -> { c } -> NULL"
  • Any exceptions or errors that come from your code should be semantic, capturable errors. For example, rather than a default error thrown by your language, your code * * should raise/throw a custom, semantic error that describes what went wrong in calling the methods you wrote for this lab.
  • Be sure to follow your language/frameworks standard naming conventions (e.g. C# uses PascalCasing for all method and class names).

Approach & Efficiency

  • insert method => Big O = 1
  • incloudes => Big O = n
  • toString method => Big O = n

data-structures-and-algorithms-401's People

Contributors

areejobaid94 avatar

Watchers

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