• The School
    • Introduction
    • Admissions
    • Academic Calendar 2026
  • Students
    • 2nd Term Routine 2026
    • Mid Term Classes 11 and 12 2026
  • Photo Gallery
  • School Events
  • Hostel
  • Higher Secondary (Arts and Science)
  • LSHSS Faculty
  • Resources
    • Digital Book Launch by Honourable Chairman LSHSS to Celebrate International Women’s Day
    • Solvable.in – A Student-Centric Learning Platform by LSHSS
    • Computer Science Class 11
    • Class 1
    • Class 2
    • Class 3
    • Class 4
    • Class 5
    • Class 6
    • Class 7
    • Class 8
    • Class 9
    • Class 10
    • Class 11
    • Class 12

Little Star Hr. Sec. School

Love Truth Service

Linked List in C++

#include <iostream>
using namespace std;
struct node
{
	int data;
	node* next;
};
class link_list
{
	node* first;
	node* last;
	public:
		link_list()
		{
			first=last = NULL;
		}
		~link_list()
		{
       // frees up memory allocated by new
		    node* current = first;
		    node* next;
		
		    while (current != NULL) 
			{
		        next = current->next;
		        delete current;
		        current = next;
		    }
		}		
		bool IsEmpty()
		{
			if(first == NULL)
			  return true;
			else
			  return false;  
		}
		void AddItem(int data)
		{
			node *temp = new node;
			temp->data = data;
			temp->next = NULL;
			if(first == NULL)
			  first = last = temp;
			else
			  last->next = temp;
		  	last = temp;
		}
		void Display()
		{
			node *current = first;
			int i=1;
			while(current!=NULL)
			{
				cout<<i<<" - "<<current->data<<endl;
				current=current->next;
				i++;
			}
		}
};

Recent Posts

  • “Importance of Music Education in Schools.”
  • Morning Assembly, 5th May 2026 Topic: ” School News” Class-10C Teacher I/C : Miss Imlibenla
  • ANPSA Badminton Tournament 2026
  • MORNING ASSEMBLY, 20th FEB. 2026 TOPIC: ” MENTAL HEALTH MATTERS- CHOOSING KINDNESS OVER BULLYING,” CLASS 7A TEACHER I/C : MADAM LORENO MURRY
  • MORNING ASSEMBLY, 17th FEB. 2026 TOPIC: ” RETELLING OF A FAVORITE STORY IN THE PROSE SECTION” CONNECT WITH ANTI- BULLYING CLASS 8C TEACHER I/C : MADAM MONITA RAI

Social Media

  • Instagram : Little Star Hr Sec School
  • Instagram : Star Kids
  • Instagram : Computer Science Dept, Little Star Hr Sec School

Little Star Higher Secondary School

Love Truth Service

Midland, Dimapur
Nagaland

Copyright © 2026 · Education Pro Theme On Genesis Framework · WordPress · Log in