LinkedList-র শুরুতে একটি নোড সরাতে RemoveFirst() পদ্ধতি ব্যবহার করুন।
string [] employees = {"Peter","Robert","John","Jacob"}; LinkedList list = new LinkedList(employees);
এখন, প্রথম উপাদানটি সরাতে RemoveFirst() পদ্ধতি ব্যবহার করুন।
list.RemoveFirst();
সম্পূর্ণ উদাহরণটি দেখি।
উদাহরণ
using System; using System.Collections.Generic; class Demo { static void Main() { string [] employees = {"Peter","Robert","John","Jacob"}; LinkedList list = new LinkedList(employees); foreach (var emp in list) { Console.WriteLine(emp); } // প্রথম নোড সরানো list.RemoveFirst(); Console.WriteLine("প্রথম নোড সরানোর পর LinkedList..."); foreach (var emp in list) { Console.WriteLine(emp); } } }
আউটপুট
Peter Robert John Jacob প্রথম নোড সরানোর পর LinkedList... Robert John Jacob