C & Data Structures ISBN:1584503386 by P.S Deshpande and O.G Kakde Charles River Media © 2004 (700 pages) This thorough text provides a comprehensive guide to all the data types in C with internal implementation, while providing examples to demonstrate their behavior CD Content Table of Contents C & Data Structures Preface Part I - C Language Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 - Introduction to the C Language - Data Types - C Operators - Control Structures - The printf Function - Address and Pointers - The scanf Function - Preprocessing - Arrays Chapter 10 - Function Chapter 11 - Storage of Variables Chapter 12 - Memory Allocation Chapter 13 - Recursion Chapter 14 - Strings Chapter 15 - Structures Chapter 16 - Union Chapter 17 - Files Part II - Data Structures Chapter 18 - Arrays, Searching, and Sorting Chapter 19 - Stacks and Queues Chapter 20 - Linked Lists Chapter 21 - Trees Chapter 22 - Graphs Part III - Advanced Problems in Data Structures Problems in Arrays, Searching, Sorting, Hashing Chapter 24 - Problems in Stacks and Queues Chapter 25 - Problems in Linked Lists Chapter 26 - Problems in Strings Chapter 27 - Problems in Trees Chapter 28 - Problems in Graphs Chapter 29 - Miscellaneous Problems Index List of Figures List of Tables CD Content Chapter 23 - Back Cover Divided into three separate sections, C & Data Structures covers C programming, as well as the implementation of data structures and an analysis of advanced data structure problems Beginning with the basic concepts of the C language (including the operators, control structures, and functions), the book progresses to show these concepts through practical application with data structures such as linked lists and trees, and concludes with the integration of C programs and advanced data structure problemsolving The book covers a vast range of data structures and programming issues, such as syntactic and semantic aspects of C, all control statements in C, concepts of function, macro, files and pointers with examples, graphs, arrays, searching and sorting techniques, stacks and queues, files, and preprocessing C & Data Structures provides a comprehensive guide to all the data types in C with internal implementation, while providing examples to demonstrate their behavior KEY FEATURES Explains all operators, expressions, control statements, and rules of C in detail Demonstrates language syntax, as well as discussing its behavior by showing specific internal implementations Covers data structures such as linked lists, trees, graphs, arrays, and commonly used algorithms, as well as advanced data structures such as B- trees and B+ trees About the Authors P.S Deshpande is a faculty member in the Department of Computer Science at Visvesvarya National Institute of Technology He has acted as a consultant to various government and private organizations in the field of database management, software engineering, data warehousing, WAP, and J2EE design patterns, and has published a number of papers on Oracle, data warehousing, and programming languages O.G Kakde is also a faculty member in the Department of Computer Science at Visvesvarya National Institute of Technology He has done consulting work for the government as well as private organizations in the fields of embedded systems, language translators, WAP, and several programming languages He is the author of Algorithms for Compiler Design C & Data Structures P S Deshpande O G Kakde CHARLES RIVER MEDIA, INC Hingham, Massachusetts Copyright © 2003 Dreamtech Press Reprint Copyright © 2004 by CHARLES RIVER MEDIA, INC All rights reserved No part of this publication may be reproduced in any way, stored in a retrieval system of any type, or transmitted by any means or media, electronic or mechanical, including, but not limited to, photocopy, recording, or scanning, without prior permission in writing from the publisher Acquisitions Editor: James Walsh Production: Dreamtech Press Cover Design: Sherry Stinson CHARLES RIVER MEDIA, INC 10 Downer Avenue Hingham, Massachusetts 02043 781-740-0400 781-740-8816 (FAX) info@charlesriver.com http://www.charlesriver.com P.S Deshpande and O.G Kakde C & Data Structures 1-58450-338-6 All brand names and product names mentioned in this book are trademarks or service marks of their respective companies Any omission or misuse (of any kind) of service marks or trademarks should not be regarded as intent to infringe on the property of others The publisher recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products Library of Congress Cataloging-in-Publication Data Deshpande, P S C & data structures / P.S Deshpande, O.G Kakde p cm ISBN 1-58450-338-6 (Paperback with CD-ROM : alk paper) C (Computer program language) 2 Data structures (Computer science) I Kakde, O G II Title QA76.73.C15D48 2003 005.7'3—dc22 2003021572 04 7 6 5 4 3 2 First Edition CHARLES RIVER MEDIA titles are available for site license or bulk purchase by institutions, user groups, corporations, etc For additional information, please contact the Special Sales Department at 781-7400400 Requests for replacement of a defective CD-ROM must be accompanied by the original disc, your mailing address, telephone number, date of purchase and purchase price Please state the nature of the problem, and send the information to CHARLES RIVER MEDIA, INC., 10 Downer Avenue, Hingham, Massachusetts 02043 CRM's sole obligation to the purchaser is to replace the disc, based on defective materials or faulty workmanship, but not on the operation or functionality of the product Acknowledgments Writing any book is not an easy task We spent about one year designing the contents, implementing the programs and testing the programs Our 12 years of teaching experience has helped us to explain the issues in the language and complex problems in data structures We are thankful to our student Rupesh Nasre who, after receiving an M.Tech degree in computer science from IIT Mumbai, helped us in implementing advanced problems in data structures We are also thankful to our students Ms Usha Agrawal and Mr Ramchandra Vibhute for helping us in writing programs for Parts I and II Preface The book is written for both undergraduate and graduate students of core computer science areas The book would be very useful for other students to learn programming for the purpose of making a career in computer science It covers all those topics that generally appear in aptitude tests and interviews It not only gives the language syntax but also discusses its behavior by showing the internal implementation We have covered almost the entire range of data structures and programming such as non-recursive implementation of tree traversals, A* algorithm in Artificial Intelligence, 8-queens problems, etc We also have supplied a CD-ROM which contains all the source material that appears in the book We welcome comments from our readers Part I: C Language Chapter 1: Introduction to the C Language Chapter 2: Data Types Chapter 3: C Operators Chapter 4: Control Structures Chapter 5: The printf Function Chapter 6: Address and Pointers Chapter 7: The scanf Function Chapter 8: Preprocessing Chapter 9: Arrays Chapter 10: Functions Chapter 11: Storage of Variables Chapter 12: Memory Allocation Chapter 13: Recursion Chapter 14: Strings Chapter 15: Structures Chapter 16: Union Chapter 17: Files Chapter 1: Introduction to the C Language ... basic concepts of the C language (including the operators, control structures, and functions), the book progresses to show these concepts through practical application with data structures such as linked lists and trees, and concludes with the integration of C. .. recognizes and respects all marks used by companies, manufacturers, and developers as a means to distinguish their products Library of Congress Cataloging-in-Publication Data Deshpande, P S C & data structures / P. S. .. and semantic aspects of C, all control statements in C, concepts of function, macro, files and pointers with examples, graphs, arrays, searching and sorting techniques, stacks and queues, files, and preprocessing