Generic collection LinkedList

LinkedList<T> is a list of objects ( nodes ) wich have a pointer to previous or next. In general it's slower as the List<T> variant because of the overhead on the entry.

Use LinkedList<T> when you have to insert or remove entry's at a specific place in the list.

Example adding entry at specific position: 

    public class Employee
        public string Voornaam { get; set; }
        public string Achternaam { get; set; }

    class Employees
        public LinkedList employeeList { get; set; }

        public Employees()
            employeeList = new LinkedList();
            employeeList.AddFirst(new Employee(){ Voornaam="a"});
            employeeList.AddFirst(new Employee() { Voornaam = "b" });
            employeeList.AddFirst(new Employee() { Voornaam = "c" });

        public void AddEntryAt(string at, string entry)
            LinkedListNode currentEmployee = employeeList.Find(employeeList.Where( a => a.Voornaam.Equals(at)).First());
            Employee newEmployee = new Employee() { Voornaam = entry };
            employeeList.AddBefore(currentEmployee, newEmployee);




Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!