Skip to Main Content
Data Structures Using C, 2nd Edition by Pearson
book

Data Structures Using C, 2nd Edition by Pearson

by A. K. Sharma
May 2024
Intermediate to advanced content levelIntermediate to advanced
521 pages
14h 12m
English
Pearson India
Content preview from Data Structures Using C, 2nd Edition by Pearson
236 Data Structures Using C
6.3.2 Travelling a Linked List
Many a times, it is required to travel whole or a part of the list. For example, the operations such as
counting of nodes, processing of information of some nodes, or printing of the list, etc. requires traversal
of the list.
Consider the linked list shown in Figure 6.12. It is pointed by First. Let us travel this list for the
purpose of counting the number of nodes in the list.
Fig. 6.12 The list pointed by First
isIndia Great Country
First
NUL
Let us use a pointer ptr to travel the list. A variable called count would be used to count the
number of nodes in the list. The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures Using C

Data Structures Using C

Samir Kumar Bandyopadhyay, Kashi Nath Dey
Intermediate C Programming, 2nd Edition

Intermediate C Programming, 2nd Edition

Yung-Hsiang Lu, George K. Thiruvathukal

Publisher Resources

ISBN: 9781299831582