Code Monkey home page Code Monkey logo

tarea3's Introduction

Tarea 3

HackerRank Modified Challenge Print a Linked List

Problem Statement

Create a class that represents a list. Such class should be able to add and remove an element of the list at a given position (index). The class should also be able to print all elements of the list on a straight line splitting each element with a comma.

In order to test the class, write a program that asks for elements to add into the list until the user types -1. Upon receiving a -1, the program should print all the elements of the list.

Extra information:

In computer science, a linked list is a data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of data and a reference (in other words, a link) to the next node in the sequence; more complex variants add additional links. This structure allows for efficient insertion or removal of elements from any position in the sequence.

Image of a linked list

Hints

The program should contain 2 classes, a class LinkedList that represents the whole list and a class Node that represents each element of the list.

Input Format

The user will input all elements of the list separated by a new line. The last element will be a -1.

Output format

The elements of the list on the same line separated by a comma.

Sample input

9
E
5
2.3
8
-1

Sample output

9,E,5,2.3,8

tarea3's People

Contributors

zenathark avatar ricardomayosa avatar

Watchers

 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.