From 3351bce3ef953740b8da592adbb68749eabb0029 Mon Sep 17 00:00:00 2001 From: orange Date: Tue, 27 Dec 2016 17:56:15 +0100 Subject: [PATCH] add LinkedList --- src/StruttureDati/LinkedList/LinkedList.java | 57 ++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/StruttureDati/LinkedList/LinkedList.java b/src/StruttureDati/LinkedList/LinkedList.java index e69de29..22b67c0 100644 --- a/src/StruttureDati/LinkedList/LinkedList.java +++ b/src/StruttureDati/LinkedList/LinkedList.java @@ -0,0 +1,57 @@ +public class LinkedList{ + + private class Node{ + public Object elem; + public Node next; + } + + public LinkedList(){ + head=null; + len=0; + } + + public Object elemAt(int pos){ + int i=0; + Node temp=head; + while(i