A Textbook of Data Structures and Algorithms, Volume 3 - G. A. Vijayalakshmi Pai - E-Book

A Textbook of Data Structures and Algorithms, Volume 3 E-Book

G. A. Vijayalakshmi Pai

0,0
126,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Data structures and algorithms is a fundamental course in Computer Science, which enables learners across any discipline to develop the much-needed foundation of efficient programming, leading to better problem solving in their respective disciplines. A Textbook of Data Structures and Algorithms is a textbook that can be used as course material in classrooms, or as self-learning material. The book targets novice learners aspiring to acquire advanced knowledge of the topic. Therefore, the content of the book has been pragmatically structured across three volumes and kept comprehensive enough to help them in their progression from novice to expert. With this in mind, the book details concepts, techniques and applications pertaining to data structures and algorithms, independent of any programming language. It includes 181 illustrative problems and 276 review questions to reinforce a theoretical understanding and presents a suggestive list of 108 programming assignments to aid in the implementation of the methods covered.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 423

Veröffentlichungsjahr: 2022

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



One of the greatest lessons I have learnt in my life is to pay as much attention to the means of work as to its end… I have been always learning great lessons from that one principle, and it appears to me that all the secret of success is there; to pay as much attention to the means as to the end…. Let us perfect the means; the end will take care of itself.

– Swami Vivekananda(Lecture Delivered at Los Angeles, California, January 4, 1900)

A Textbook of Data Structures and Algorithms 3

Mastering Advanced Data Structures and Algorithm Design Strategies

G A Vijayalakshmi Pai

First published 2022 in Great Britain and the United States by ISTE Ltd and John Wiley & Sons, Inc.

Previous edition published in 2008 as “Data Structures and Algorithms: Concepts, Techniques and Applications” by McGraw Hill Education (India) Pvt Ltd. © McGraw Hill Education (India) Pvt Ltd. 2008

Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms and licenses issued by the CLA. Enquiries concerning reproduction outside these terms should be sent to the publishers at the undermentioned address:

ISTE Ltd

John Wiley & Sons, Inc.

27-37 St George’s Road

111 River Street

London SW19 4EU

Hoboken, NJ 07030

UK

USA

www.iste.co.uk

www.wiley.com

© ISTE Ltd 2022The rights of G A Vijayalakshmi Pai to be identified as the author of this work have been asserted by her in accordance with the Copyright, Designs and Patents Act 1988.

Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s), contributor(s) or editor(s) and do not necessarily reflect the views of ISTE Group.

Library of Congress Control Number: 2022947642

British Library Cataloguing-in-Publication Data

A CIP record for this book is available from the British Library

ISBN 978-1-78630-892-4

Preface

Efficient problem solving using computers, irrespective of the discipline or application, calls for the design of efficient algorithms. The inclusion of appropriate data structures is of critical importance to the design of efficient algorithms. In other words, good algorithm design must go hand in hand with appropriate data structures for an efficient program design to solve a problem.

Data structures and algorithms is a fundamental course in computer science, which most undergraduate and graduate programs in computer science and other allied disciplines in science and engineering offer during the early stages of the respective programs, either as a core or as an elective course. The course enables students to have a much-needed foundation for efficient programming, leading to better problem solving in their respective disciplines.

Most of the well-known text books/monographs on this subject have discussed the concepts in relation to a programming language – beginning with Pascal and spanning a spectrum of them such as C, C++, C#, Java, Python and so on, essentially calling for ample knowledge of the language, before one proceeds to try and understand the data structure. There does remain a justification in this. The implementation of data structures in the specific programming language need to be demonstrated or the algorithms pertaining to the data structures concerned need a convenient medium of presentation and when this is the case, why not a programming language?

Again, while some authors have insisted on using their books for an advanced level course, there are some who insist on a working knowledge of the specific programming language as a prerequisite to using the book. However, in the case of a core course, as it is in most academic programs, it is not uncommon for a novice or a sophomore to be bewildered by the “miles of code” that demonstrate or explain a data structure, rendering the subject difficult to comprehend. In fact, the efforts that one needs to put in to comprehend the data structure and its applications are distracted by the necessity to garner sufficient programming knowledge to follow the code. It is indeed ironic that while a novice is taught data structures to appreciate programming, in reality it turns out that one learns programming to appreciate data structures!

In my decades-old experience of offering the course to graduate programs, which admits students from diverse undergraduate disciplines, with little to no strong knowledge of programming, I had several occasions to observe this malady. In fact, it is not uncommon in some academic programs, especially graduate programs which, due to their shorter duration, have a course in programming and data structures running in parallel in the same semester, much to the chagrin of the novice learner! That a novice is forced to learn data structures through their implementation (in a specific programming language), when in reality it ought to be learning augmented with the implementation of the data structures, has been the reason behind the fallout.

A solution to this problem would be to

Frame the course such that the theory deals with the concepts, techniques and applications of data structures and algorithms, not taking recourse to any specific programming language, but instead settling for a pseudo-language, which clearly expounds the data structure. Additionally, supplementing the course material with illustrative problems, review questions and exercises to reinforce the students’ grasp of the concepts would help them gain useful insights while learning.

Augment the theory with laboratory sessions to enable the student to implement the data structure in itself or as embedded in an application, in the language of his/her own choice or as insisted upon in the curriculum. This would enable the student who has acquired sufficient knowledge and insight into the data structures to appreciate the beauty and merits of employing the data structure by programming it themself, rather than “look” for the data structure in a prewritten code.

This means that text books catering to the fundamental understanding of the data structure concepts for use as course material in the classroom are as much needed as the books that cater to the implementation of data structures in a programming language for use in the laboratory sessions. While most books in the market conform to the latter, bringing out a book to be classroom course material and used by instructors handling a course on data structures and algorithms, comprehensive enough for the novice students to benefit from, has been the main motivation in writing this book.

As such, the book details concepts, techniques and applications pertaining to data structures and algorithms, independent of any programming language, discusses several examples and illustrative problems, poses review questions to reinforce the understanding of the theory, and presents a suggestive list of programming assignments to aid implementation of the data structures and algorithms learned.

In fact, the book may either be independently used as a textbook since it is self-contained or serve as a companion for books discussing data structures and algorithms implemented in specific programming languages such as C, C++, Java, Python, and so on.

At this juncture, it needs to be pointed out that a plethora of programming resources and freely downloadable implementations of the majority of the data structures in almost all popular languages are available on the Internet, which can undoubtedly serve as good guides for the learner. However, it has to be emphasized that an earnest student of data structures and algorithms must invest a lot of time and self-effort in trying to implement the data structures and algorithms learned, in a language of one’s choice, all by oneself, in order to attain a thorough grasp of the concepts.

About this edition

This edition is a largely revised and enlarged version of its predecessor, published by McGraw Hill, USA. The earlier edition published in 2008 saw 15 reprints in its life span of 13 years (ending January 2022) and was recommended as a text book for the course in several universities and colleges. It comprised 17 chapters categorized into five parts and reinforced learning through 133 illustrative problems, 215 review questions and 74 programming assignments.

The features of this new edition are as follows:

There are 22 chapters spread across three volumes that detail sequential linear data structures, linked linear data structures, nonlinear data structures, advanced data structures, searching and sorting algorithms, algorithm design techniques and NP-completeness.

The data structures of

k

-d trees and treaps have been elaborated in a newly included chapter (

Chapter 15

) in Volume 3.

The data structures of strings, bit rays, unrolled linked lists, self-organizing linked lists, segment trees and

k

-ary trees have been introduced in the appropriate sections of the existing chapters in Volumes 1 and 2.

The concepts of counting binary search trees and Kruskal’s algorithm have been detailed in the appropriate sections of the existing chapters in Volume 2.

Skip list search, counting sort and bucket sort have been included in the chapters on searching and sorting algorithms in Volume 3.

The algorithm design techniques of divide and conquer, the greedy method and dynamic programming have been elaborately discussed in

Chapters 19

21

in Volume 3.

The concept of NP-completeness has been detailed in a newly included chapter,

Chapter 22

in Volume 3.

Several illustrative problems, review questions and programming assignments have been added to enrich the content and aid in understanding the concepts. The new edition thus includes 181 illustrative problems, 276 review questions and 108 programming assignments.

Organization of the book

The book comprises three volumes, namely, Volume 1: Chapters 1–7, Volume 2: Chapters 8–12 and Volume 3: Chapters 13–22.

Volume 1 opens with an introduction to data structures and concepts pertaining to the analysis of algorithms, detailed in Chapters 1 and 2, which is essential to appreciate the theories and algorithms related to data structures and their applications.

Chapters 3–5 detail sequential linear data structures, namely, arrays, strings, bit arrays, stacks, queues, priority queues and dequeues, and their applications. Chapters 6 and 7 elucidate linked linear data structures, namely linked lists, linked stacks and linked queues, and their applications.

Volume 2 details nonlinear data structures. Chapters 8 and 9 elaborate on the nonlinear data structures of trees, binary trees and graphs, and their applications. Chapters 10–12 highlight the advanced data structures of binary search trees, AVL trees, B trees, tries, red-black trees and splay trees, and their applications.

Volume 3 details an assortment of data structures, algorithm design strategies and their applications.

Chapters 13–15 discuss hash tables, files, k-d trees and treaps. Chapter 16 discusses the search algorithms of linear search, transpose sequential search, interpolation search, binary search, Fibonacci search, skip list search and other search techniques.

Chapter 17 elaborates on the internal sorting algorithms of bubble sort, insertion sort, selection sort, merge sort, shell sort, quick sort, heap sort, radix sort, counting sort and bucket sort, and Chapter 18 discusses the external sorting techniques of sorting with tapes, sorting with disks, polyphase merge sort and cascade merge sort.

Chapters 19–21 detail the algorithm design strategies of divide and conquer, the greedy method and dynamic programming and their applications.

Chapter 22 introduces the theories and concepts of NP-completeness.

For a full list of the contents of Volumes 2 and 3, see the summary at the end of this book.

Salient features of the book

The features of the book are as follows:

all-around emphasis on theory, problems, applications and programming assignments;

simple and lucid explanation of the theory;

inclusion of several applications to illustrate the use of data structures and algorithms;

several worked-out examples as illustrative problems in each chapter;

list of programming assignments at the end of each chapter;

review questions to strengthen understanding;

self-contained text for use as a text book for either an introductory or advanced level course.

Target audience

The book could be used both as an introductory or an advanced-level textbook for undergraduate, graduate and research programs, which offer data structures and algorithms as a core course or an elective course. While the book is primarily meant to serve as a course material for use in the classroom, it could be used as a companion guide during the laboratory sessions to nurture better understanding of the theoretical concepts.

An introductory level course for a duration of one semester or 60 lecture hours, targeting an undergraduate program or first-year graduate program or a diploma program or a certificate program, could include Chapters 1–7 of Volume 1, Chapter 8 of Volume 2, Chapters 13, 16 (sections 16.1, 16.2, 16.5) and 17 (sections 17.1–17.3, 17.5, 17.7) of Volume 3 in its curriculum.

A middle-level course for a duration of one semester or 60 lecture hours targeting senior graduate-level programs and research programs such as MS/PhD could include Chapters 1–7 of Volume 1, Chapters 8–11 of Volume 2, Chapter 13 and selective sections of Chapters 16–17 of Volume 3.

An advanced level course that focuses on advanced data structures and algorithm design could begin with a review of Chapter 8 and include Chapters 9–12 of Volume 2, Chapters 14 and 15 and selective sections of Chapters 16–18, and Chapters 19–22 of Volume 3 in its curriculum based on the level of prerequisite courses satisfied.

Chapters 8–10 and Chapter 11 (sections 11.1–11.3) of Volume 2 and Chapters 13, 14 and 18 of Volume 3 could be useful to include in a curriculum that serves as a prerequisite for a course on database management systems.

To re-emphasize, all theory sessions must be supplemented with laboratory sessions to encourage learners to implement the concepts learned in an appropriate language that adheres to the curricular requirements of the programs concerned.

Acknowledgments

The author is grateful to ISTE Ltd., London, UK, for accepting to publish the book, in collaboration with John Wiley & Sons Inc., USA. She expresses her appreciation to the publishing team, for their professionalism and excellent production practices, while bringing out this book in three volumes.

The author expresses her sincere thanks to the Management and Principal, PSG College of Technology, Coimbatore, India for the support extended while writing the book.

The author would like to place on record her immense admiration and affection for her father, Late Professor G. A. Krishna Pai and her mother Rohini Krishna Pai for their unbounded encouragement and support to help her follow her life lessons and her sisters Dr. Rekha Pai and Udaya Pai, for their unstinted, anywhere-anytimeanything kind of help and support, all of which were instrumental and inspirational in helping this author create this work.

G. A. Vijayalakshmi PaiAugust 2022