Chapter 17: Lumping Related Data in Records . . . . . . . . . . . . . . . . . .235 Creating a Record ........................................................................................236 Manipulating Data in Records ...................................................................237 Storing data in a record ....................................................................237 Retrieving data from a record ..........................................................238 Using Records with Arrays ........................................................................239

xiii Table of Contents

Beginning Programming For Dummies, 3rd Edition xiv

Chapter 18: Linked Lists and Pointers . . . . . . . . . . . . . . . . . . . . . . . . . .241 Starting with a Pointer ................................................................................241 Defining the parts of a linked list ....................................................243 Creating a linked list .........................................................................245 Managing a linked list .......................................................................247 Making Data Structures with Linked Lists ...............................................249 Double-linked lists .............................................................................249 Circular-linked lists ...........................................................................250 Stacks ..................................................................................................251 Queues ................................................................................................252 Trees ...................................................................................................253 Graphs .................................................................................................254

Chapter 19: Playing with Object-Oriented Programming . . . . . . . . .255 The Problem with Software .......................................................................256 Ways to Make Programming Easier ..........................................................256 Breaking Programs into Objects ...............................................................258 How to use objects ............................................................................259 How to create an object ....................................................................261 Writing an object's methods ............................................................262 Creating an object .............................................................................263 Choosing an Object-Oriented Language ...................................................265

Part V: Algorithms: Telling the Computer What to Do ..............................................................267

Chapter 20: Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269 Insertion Sort ...............................................................................................270 Bubble Sort ..................................................................................................273 Shell Sort ......................................................................................................276 Quicksort ......................................................................................................280 Sorting Algorithms ......................................................................................283

Chapter 21: Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .287 Searching Sequentially ...............................................................................287 Performing a Binary Search .......................................................................289 Hashing .........................................................................................................292 Dealing with collisions ......................................................................293 Searching by using a hash function ................................................294 Picking a Searching Algorithm ...................................................................297

computer programming for dummiesWhere stories live. Discover now