DATA STRUCTURES AND ALGORITHMS
Class and union
Destructor and constructor
In this lesson, we have learnt that a class is a template used to create objects. An
object is an instance of a class. The objects bind together data and methods that
will act on the data. Examples of classes can be tree, linked list, queue, stack e.t.c.
The members of a class can be classified into data members and member
functions. The member functions can be defined inside class declaration or
outside. Constructor and destructor are two important member functions used to
initialize an object and delete an object from memory respectively.
Data structures using C and C++, 2nd Edition by Yedidyah Langsam, Aaron
J.Augenstein and Aaron M.Tenebaum: Pubslisher: Pearson.
Data structures and algorithms in c++ by Michael T.Goodrich,Robertio Tamassia and
David Mount: Publisher: Wiley
Fundamentals of data structures in c++ by Ellis Horowitz,Sartaj Sahni and Dinesh
Introduction to data structures and algorithms with c++ by Glenn W.Rowe .
Publisher: Prentice Hall.
Lesson 7: Linked lists
A linked list is a linear data structure which consists of collection of nodes. Each node
in the list has two components:
Data field- To store the values
Link field-To store address to the next node
Header (first): Contains address to the first node. The last node points to null.
By the end of this lesson, the students should be able to:
Explain applications of a linked list
Discuss operations that can be applied on linked lists
Create and use linked lists using pointers
This lesson is organized as follows: