Skip to content

RachelPol/LINKLIST

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

LINKLIST

using System;

namespace LinkedList { public class CustomLinkedList { Item Head = null; public void AddItam(string str) { if (Head == null) { Head = new Item(); Head.name = str; Head.prev = null; Head.next = null; } else { Item newItem = new Item(); newItem.name = str;

            Item curr = Head;
            while (curr.next != null)
            {
                curr = curr.next;
            }

            curr.next = newItem;
            newItem.prev = curr;
        }
    }
    public void Delete()
    {
      
        Item curr = Head;
        while (curr.next != null)
        {
            curr = curr.next;

        }

        Item temp = curr; 
        curr = curr.prev;
        curr.next = null;
        temp.prev = null;
    }
    public string ToString()
    {
        String res = " "; 
        while (curr.next != null)
        {
            res = (res + name + ",");
            curr = curr.next;
        }
    }

}

}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published