0%

Book Description

This book has been designed for the course on Programming and Data Structures for the undergraduate students of Anna University, Chennai. It integrates the core concepts of C Programming and Data Structures into a single comprehensive textbook. The contents of the book are student-friendly, example-driven and program-oriented. Based on the belief that expertise is achieved by practice, this comprehensive book is enriched with illustrations and about 400 solved programs. Each concept of C Programming and Data Structure is explained easily and the reader is then taken straight to the applications. A student can follow the fundamental concepts and run the programs as illustrated. It does not assume prior knowledge of C programming.

Table of Contents

  1. Cover
  2. Preface
  3. Contents (1/2)
  4. Contents (2/2)
  5. Course Syllabus
  6. Chapter 1: Program Development Styles and Basics of C
    1. 1.1 Program Development Methodologies
      1. Monolithic Programming
      2. Procedural Programming
    2. 1.2 Programming Style
    3. 1.3 Stepwise Refinement and Modularity
    4. 1.4 Problem Solving Techniques
    5. 1.5 Algorithm
      1. Classification of Algorithms
    6. 1.6 Flowcharts
    7. 1.7 Pseudocode
    8. 1.8 Sequence and Selection
    9. 1.9 Iteration and Recursion
      1. Iteration
      2. Recursion
    10. 1.10 Recursion Versus Iteration
    11. 1.11 Overview of Compilers and Interpreters
    12. 1.12 Structure of A C Program
    13. 1.13 Programming Rules
    14. 1.14 Executing the Program
    15. Summary
    16. Exercises
  7. Chapter 2: The C Declarations
    1. 2.1 Introduction
    2. 2.2 The C Character Set
    3. 2.3 Delimiters
    4. 2.4 The C Keywords
    5. 2.5 Identifiers
    6. 2.6 Constants
      1. A. Numerical Constants
      2. B. Character Constants
    7. 2.7 Variables
    8. 2.8 Rules for Defining Variables
    9. 2.9 'C' Aggregate Data Types
      1. Basic Data Type
      2. Derived Data Type
    10. 2.10 Declaring Variables
    11. 2.11 Initializing Variables
    12. 2.12 Type Conversion
    13. Summary
    14. Exercises
  8. Chapter 3: Operators and Expressions
    1. 3.1 Introduction
    2. 3.2 Priority of Operators and their Clubbing
    3. 3.3 Comma and Conditional Operator
      1. Syntax
    4. 3.4 Arithmetic Operators
    5. 3.5 Relational Operators
    6. 3.6 Logical Operators
    7. 3.7 Bitwise Operators (1/2)
    8. 3.7 Bitwise Operators (2/2)
    9. Summary
    10. Exercises
  9. Chapter 4: Input and Output in C
    1. 4.1 Introduction
    2. 4.2 Formatted Functions
      1. Syntax (1/2)
      2. Syntax (2/2)
    3. 4.3 Unformatted Functions
      1. a) Character I/O
      2. b) String I/O
      3. Syntax
      4. Syntax
    4. 4.4 Commonly Used Library Functions
      1. Syntax
      2. Syntax
      3. Syntax
      4. Syntax
    5. Summary
    6. Exercises
  10. Chapter 5: Decision Statements
    1. 5.1 Introduction
    2. 5.2 The if Statement
    3. 5.3 The if . . . else Statement
    4. 5.4 Nested if - else Statement (1/2)
    5. 5.4 Nested if - else Statement (2/2)
    6. 5.5 The break Statement
    7. 5.6 The continue Statement
    8. 5.7 The goto Statement
    9. 5.8 The switch Statement (1/3)
    10. 5.8 The switch Statement (2/3)
    11. 5.8 The switch Statement (3/3)
    12. 5.9 Nested switch () Case
    13. 5.10 The switch () Case and Nested IFS
    14. Summary
    15. Exercises
  11. Chapter 6: Loop Control Statements
    1. 6.1 Introduction
    2. 6.2 The for Loop (1/4)
    3. 6.2 The for Loop (2/4)
    4. 6.2 The for Loop (3/4)
    5. 6.2 The for Loop (4/4)
    6. 6.3 Nested for Loops (1/6)
    7. 6.3 Nested for Loops (2/6)
    8. 6.3 Nested for Loops (3/6)
    9. 6.3 Nested for Loops (4/6)
    10. 6.3 Nested for Loops (5/6)
    11. 6.3 Nested for Loops (6/6)
    12. 6.4 The while Loop (1/3)
    13. 6.4 The while Loop (2/3)
    14. 6.4 The while Loop (3/3)
    15. 6.5 The do-while (1/2)
    16. 6.5 The do-while (2/2)
    17. 6.6 The do-while Statement with while Loop
    18. Summary
    19. Exercises
  12. Chapter 7: Arrays
    1. 7.1 Introduction
    2. 7.2 Array Initialization
    3. 7.3 Definition of Array
    4. 7.4 Characteristic of Array
    5. 7.5 One-dimensional Array (1/3)
    6. 7.5 One-dimensional Array (2/3)
    7. 7.5 One-dimensional Array (3/3)
    8. 7.6 Predefined Streams
    9. 7.7 Two-dimensional Array (1/4)
    10. 7.7 Two-dimensional Array (2/4)
    11. 7.7 Two-dimensional Array (3/4)
    12. 7.7 Two-dimensional Array (4/4)
    13. 7.8 Three- or Multi-dimensional Arrays
    14. 7.9 The sscanf () and sprintf () Functions
    15. Summary
    16. Exercises
  13. Chapter 8: Working with Strings & Standard Functions
    1. 8.1 Introduction
    2. 8.2 Declaration and Initialization of String
      1. The Output will be SANJAY
    3. 8.3 Display of Strings with Different Formats
      1. Where, the text is 'PRABHAKAR'
    4. 8.4 String Standard Functions (1/5)
    5. 8.4 String Standard Functions (2/5)
    6. 8.4 String Standard Functions (3/5)
    7. 8.4 String Standard Functions (4/5)
    8. 8.4 String Standard Functions (5/5)
    9. 8.5 Applications of Strings (1/2)
    10. 8.5 Applications of Strings (2/2)
    11. Summary
    12. Exercises
  14. Chapter 9: Pointers
    1. 9.1 Introduction
    2. 9.2 Features of Pointers
    3. 9.3 Pointer Declaration (1/2)
    4. 9.3 Pointer Declaration (2/2)
    5. 9.4 Arithmetic Operations with Pointers
    6. 9.5 Pointers and Arrays (1/2)
    7. 9.5 Pointers and Arrays (2/2)
    8. 9.6 Pointers and Two-dimensional Arrays
    9. 9.7 Array of Pointers
    10. 9.8 Pointers to Pointers
    11. 9.9 Pointers and Strings (1/2)
    12. 9.9 Pointers and Strings (2/2)
    13. 9.10 Void Pointers
    14. Summary
    15. Exercises
  15. Chapter 10: Functions
    1. 10.1 Introduction
    2. 10.2 Definition of a Function
      1. Why use Functions
      2. How a Function Works
    3. 10.3 Declaration of a Function
    4. 10.4 The Return Statement
    5. 10.5 Types of Functions (1/2)
    6. 10.5 Types of Functions (2/2)
    7. 10.6 Call by Value and Reference
    8. 10.7 Function Returning More Values
    9. 10.8 Function as an Argument
    10. 10.9 Functions with Arrays and Pointers (1/2)
    11. 10.9 Functions with Arrays and Pointers (2/2)
    12. 10.10 Recursion
    13. Summary
    14. Exercises
  16. Chapter 11: Preprocessor Directives
    1. 11.1 Introduction
    2. 11.2 The #define Directive
    3. 11.3 Undefining a Macro
      1. Syntax
    4. 11.4 Token Pasting and Stringizing Operators
    5. 11.5 The # include Directive
    6. 11.6 Conditional Compilation
      1. Syntax
    7. 11.7 The #ifndef Directive
    8. 11.8 The #error Directive
    9. 11.9 The # line Directive
    10. 11.10 Inline Directive
    11. 11.11 The #pragma Saveregs
    12. 11.12 The #pragma Directive
      1. Syntax
    13. 11.13 The Predefined Macros in Ansi and Turbo C
    14. 11.14 Standard I/O Predefined Streams in stdio.h
    15. 11.15 The Predefined Macros inctype. h
    16. Summary
    17. Exercises
  17. Chapter 12: Structure and Union
    1. 12.1 Introduction
    2. 12.2 Features of Structures
    3. 12.3 Declaration and Initialization of Structures
    4. 12.4 Structure within Structure
    5. 12.5 Array of Structures
    6. 12.6 Pointer to Structure
    7. 12.7 Structure and Functions
    8. 12.8 typedef
    9. 12.9 Bit Fields
    10. 12.10 Enumerated Data Type
    11. 12.11 Union
    12. 12.12 Calling Bios and Dos Services (1/2)
    13. 12.12 Calling Bios and Dos Services (2/2)
    14. 12.13 Union of Structures
    15. Summary
    16. Exercises
  18. Chapter 13: Files
    1. 13.1 Introduction
      1. A) Definition of File
    2. 13.2 Streams and File Types
      1. A) File Types
    3. 13.3 Steps for File Operations
      1. Syntax for opening the file
      2. A. Text Modes
      3. Syntax
      4. Syntax
      5. Syntax
      6. B Binary Modes
    4. 13.4 File I/O
      1. Syntax
    5. 13.5 Structures Read and Write
    6. 13.6 Other File Function
    7. 13.7 Searching Errors in Reading/Writing Files (1/3)
    8. 13.7 Searching Errors in Reading/Writing Files (2/3)
    9. 13.7 Searching Errors in Reading/Writing Files (3/3)
    10. 13.8 Low Level Disk I/O
    11. 13.9 Command Line Arguments
    12. 13.10 Application of Command Line Arguments
      1. 3. Rename
    13. 13.11 Environment Variables
    14. 13.12 I/O Re direction
    15. Summary
    16. Exercises
  19. Chapter 14: Linear Data Structure
    1. 14.1 Introduction to Data Structure
    2. 14.2 List
    3. 14.3 Implementation of a List
    4. 14.4 Traversal of a List
    5. 14.5 Searching and Retrieving an Element
    6. 14.6 Predecessor and Successor
    7. 14.7 Insertion
    8. 14.8 Deletion
    9. 14.9 Sorting
    10. 14.10 Merging Lists
    11. 14.11 Representation of a Stack
    12. 14.12 Stack-Related Terms
    13. 14.13 Operation on a Stack
    14. 14.14 Implementation of a Stack
    15. 14.15 Queues
    16. 14.16 Various Positions of Queue
    17. 14.17 Representation of Queue
    18. 14.18 Single Linked List
    19. 14.19 Linked List with and without Header
      1. Linked List with Header
      2. Linked List without Header
    20. 14.20 Insertion
      1. Insertion of the Node at the Starting
      2. Insertion of the Node at the End
      3. Insertion of a Node at a Given Position
      4. Counting Nodes
    21. 14.21 Deletion
    22. 14.22 Double Linked List
      1. Insertion
      2. Deletion
    23. 14.23 Applications
      1. Polynomial Operation
      2. Linked Dictionary
    24. Summary
    25. Exercises
  20. Chapter 15: Non-Linear Data Structure
    1. 15.1 Trees
    2. 15.2 Binary Trees
    3. 15.3 Types of Binary Tree
    4. 15.4 Binary Tree Representation
    5. 15.5 Traversing Binary Trees (1/2)
    6. 15.5 Traversing Binary Trees (2/2)
    7. 15.6 Binary Search Tree
    8. 15.7 Insertion and Deletion Operations
    9. 15.8 Hashing Technology (1/3)
    10. 15.8 Hashing Technology (2/3)
    11. 15.8 Hashing Technology (3/3)
    12. Summary
    13. Exercises
  21. Chapter 16: Searching and Sorting
    1. 16.1 Introduction
    2. 16.2 Searching
    3. 16.3 Linear (Sequential) Search
    4. 16.4 Binary Search
    5. 16.5 Sorting
    6. 16.6 Insertion Sort
    7. 16.7 Selection Sort
      1. Time Complexity
      2. Comparison with Other Methods
    8. 16.8 Bubble Sort
      1. Time Complexity
    9. 16.9 Quick Sort
      1. Time Complexity
      2. Comparison with Other Methods
    10. 16.10 Tree Sort
      1. Time Complexity
    11. Summary
    12. Exercises
3.145.66.94