本人小硕,现在的公司的都tmd太急功近利了,到了就想让干活,真tmd近视!
今天开始,再把数据结构Java版弄一遍,以后非得把那些孙子整趴下!
DATA STRUCTURES AND ALGORITHMS IN JAVA
Table of Contents
Data Structures and Algorithms in Java
Introduction
Part I
Chapter 1 - Overview
Chapter 2 - Arrays
Chapter 3 - Simple Sorting
Part II
Chapter 4 - Stacks and Queues
Chapter 5 - Linked Lists
Chapter 6 - Recurion
Part III
Chapter 7 - Advanced Sorting
Chapter 8 - Binary Trees
Chapter 9 - Red-Black Trees
Part IV
Chapter 10 - 2-3-4 Trees and External Storage
Chapter 11 - Hash Tables
Chapter 12 - Heaps
Part V
Chapter 13 - Graphs
Chapter 14 - Weighted Graphs
Chapter 15 - When to Use What
Part VI Appendixes
Appendix A - How to Run the Workshop Applets and Example Programs
Appendix B - Further Reading
Back Cover
• Data Structures and Algorithms in Java, by Robert Lafore (The Waite Group, 1998) "A beautifully written and illustrated introduction to manipulating data in practical ways, using Java examples."
• Designed to be the most easily understood book ever written on data structures and algorithms
• Data Structures and Algorithms is taught with "Workshop Applets+ -animated Java programs that introduce complex topics in an intuitively obvious way
• The text is clear, straightforward, non-academic, and supported by numerous figures
• Simple programming examples are written in Java, which is easier to understand than C++
About the Author
Robert Lafore has degrees in Electrical Engineering and Mathematics, has worked as a systems analyst for the Lawrence Berkeley Laboratory, founded his own software company, and is a best-selling writer in the field of computer programming. Some of his current titles are C++ Interactive Course, Object-Oriented Programming in C++, and C Programming Using Turbo C++. Earlier best-selling titles include Assembly Language Primer for the IBM PC and XT and (back at the beginning of the computer revolution) Soul of CP/M.
[color=blue][b]Data Structures and Algorithms in Java[/b][/color]
不重要[略去]
[color=blue][b]Introduction[/b][/color]
This introduction tells you briefly
• What this book is about
• Why it's different
• Who might want to read it
• What you need to know before you read it
• The software and equipment you need to use it
• How this book is organized
What This Book Is About
This book is about data structures and algorithms as used in computer programming. Data structures are ways in which data is arranged in your computer's memory (or stored on disk). Algorithms are the procedures a software program uses to manipulate the data in these structures.
Almost every computer program, even a simple one, uses data structures and algorithms. For example, consider a program that prints address labels. The program might use an array containing the addresses to be printed, and a simple for loop to step through the array, printing each address.
The array in this example is a data structure, and the for loop, used for sequential access to the array, executes a simple algorithm. For uncomplicated programs with small amounts of data, such a simple approach might be all you need. However, for programs that handle even moderately large amounts of data, or that solve problems that are slightly out of the ordinary, more sophisticated techniques are necessary. Simply knowing the syntax of a computer language such as Java or C++ isn't enough.
This book is about what you need to know after you've learned a programming language. The material we cover here is typically taught in colleges and universities as a second-year course in computer science, after a student has mastered the fundamentals of programming.
What's Different About This Book
There are dozens of books on data structures and algorithms. What's different about this one? Three things:
• Our primary goal in writing this book is to make the topics we cover easy to understand.
• Demonstration programs called Workshop applets bring to life the topics we cover, showing you step by step, with "moving pictures," how data structures and algorithms work.
• The example code is written in Java, which is easier to understand than C,C++, or Pascal, the languages traditionally used to demonstrate computer science topics.
Let's look at these features in more detail.
[b]Easy to Understand[/b]
Typical computer science textbooks are full of theory, mathematical formulas, and abstruse examples of computer code. This book, on the other hand, concentrates on simple explanations of techniques that can be applied to real-world problems. We avoid complex proofs and heavy math. There are lots of figures to augment the text.
Many books on data structures and algorithms include considerable material on software engineering. Software engineering is a body of study concerned with designing and implementing large and complex software projects.
However, it's our belief that data structures and algorithms are complicated enough without involving this additional discipline, so we have deliberately de-emphasized software engineering in this book. (We'll discuss the relationship of data structures and algorithms to software engineering in Chapter 1," Overview.")
de-emphasize [di:'emfəsaiz] vt. 不再重视,不再强调
Of course we do use an object-oriented approach, and we discuss various aspects of object-oriented design as we go along, including a mini-tutorial on OOP in Chapter 1. Our primary emphasis, however, is on the data structures and algorithms themselves.
[b]Workshop Applets[/b]
The CD-ROM that accompanies this book includes demonstration programs, in the form of Java applets, that cover the topics we discuss. [u]These applets, which we call Workshop applets, will run on many computer systems, appletviewers, and Web browsers. (See the readme file on the CD-ROM for more details on compatibility.)[/u] The Workshop applets create graphic images that show you in "slow motion" how an algorithm works.
For example, in one Workshop applet, each time you push a button, a bar chart shows you one step in the process of sorting the bars into ascending order. The values of variables used in the sorting algorithm are also shown, so you can see exactly how the computer code works when executing the algorithm. Text displayed in the picture explains what's happening.
Another applet models a binary tree. Arrows move up and down the tree, so you can follow the steps involved in inserting or deleting a node from the tree. There are more than 20 Workshop applets—at least one for every major topic in the book.
These Workshop applets make it far more obvious what a data structure really looks like, or what an algorithm is supposed to do, than a text description ever could. Of course, we provide a text description as well. The combination of Workshop applets, clear text, and illustrations should make things easy.
These Workshop applets are standalone graphics-based programs. You can use them as a learning tool that augments the material in the book. (Note that they're not the same as the example code found in the text of the book, which we'll discuss next.)
standalone adj. 单独的
[b]Java Example Code[/b]
The Java language is easier to understand (and write) than languages such as C and C++. The biggest reason for this is that Java doesn't use pointers. Although it surprises some people, pointers aren't necessary for the creation of complex data structures and algorithms. In fact, eliminating pointers makes such code not only easier to write and to understand, but more secure and less prone to errors as well.
Java is a modern object-oriented language, which means we can use an object-oriented approach for the programming examples. This is important, because object-oriented programming (OOP) offers compelling advantages over the old-fashioned procedural approach, and is quickly supplanting it for serious program development. Don't be alarmed if you aren't familiar with OOP. It's not that hard to understand, especially in a pointer-free environment such as Java. We'll explain the basics of OOP in Chapter 1.
The Software You Need to Use this Book
All the software you need to use this book is included on the accompanying CD-ROM. To run the Workshop applets you need a Web browser or an appletviewer utility such as the one in the Sun Microsystems Java Development Kit (JDK). Both a browser and the JDK are included on the CD-ROM. To compile and run the example programs you'll need the JDK. Microsoft Windows and various other platforms are supported. See the readme file on the included CD-ROM for details on supported platforms and equipment requirements.
今天开始,再把数据结构Java版弄一遍,以后非得把那些孙子整趴下!
DATA STRUCTURES AND ALGORITHMS IN JAVA
Table of Contents
Data Structures and Algorithms in Java
Introduction
Part I
Chapter 1 - Overview
Chapter 2 - Arrays
Chapter 3 - Simple Sorting
Part II
Chapter 4 - Stacks and Queues
Chapter 5 - Linked Lists
Chapter 6 - Recurion
Part III
Chapter 7 - Advanced Sorting
Chapter 8 - Binary Trees
Chapter 9 - Red-Black Trees
Part IV
Chapter 10 - 2-3-4 Trees and External Storage
Chapter 11 - Hash Tables
Chapter 12 - Heaps
Part V
Chapter 13 - Graphs
Chapter 14 - Weighted Graphs
Chapter 15 - When to Use What
Part VI Appendixes
Appendix A - How to Run the Workshop Applets and Example Programs
Appendix B - Further Reading
Back Cover
• Data Structures and Algorithms in Java, by Robert Lafore (The Waite Group, 1998) "A beautifully written and illustrated introduction to manipulating data in practical ways, using Java examples."
• Designed to be the most easily understood book ever written on data structures and algorithms
• Data Structures and Algorithms is taught with "Workshop Applets+ -animated Java programs that introduce complex topics in an intuitively obvious way
• The text is clear, straightforward, non-academic, and supported by numerous figures
• Simple programming examples are written in Java, which is easier to understand than C++
About the Author
Robert Lafore has degrees in Electrical Engineering and Mathematics, has worked as a systems analyst for the Lawrence Berkeley Laboratory, founded his own software company, and is a best-selling writer in the field of computer programming. Some of his current titles are C++ Interactive Course, Object-Oriented Programming in C++, and C Programming Using Turbo C++. Earlier best-selling titles include Assembly Language Primer for the IBM PC and XT and (back at the beginning of the computer revolution) Soul of CP/M.
[color=blue][b]Data Structures and Algorithms in Java[/b][/color]
不重要[略去]
[color=blue][b]Introduction[/b][/color]
This introduction tells you briefly
• What this book is about
• Why it's different
• Who might want to read it
• What you need to know before you read it
• The software and equipment you need to use it
• How this book is organized
What This Book Is About
This book is about data structures and algorithms as used in computer programming. Data structures are ways in which data is arranged in your computer's memory (or stored on disk). Algorithms are the procedures a software program uses to manipulate the data in these structures.
Almost every computer program, even a simple one, uses data structures and algorithms. For example, consider a program that prints address labels. The program might use an array containing the addresses to be printed, and a simple for loop to step through the array, printing each address.
The array in this example is a data structure, and the for loop, used for sequential access to the array, executes a simple algorithm. For uncomplicated programs with small amounts of data, such a simple approach might be all you need. However, for programs that handle even moderately large amounts of data, or that solve problems that are slightly out of the ordinary, more sophisticated techniques are necessary. Simply knowing the syntax of a computer language such as Java or C++ isn't enough.
This book is about what you need to know after you've learned a programming language. The material we cover here is typically taught in colleges and universities as a second-year course in computer science, after a student has mastered the fundamentals of programming.
What's Different About This Book
There are dozens of books on data structures and algorithms. What's different about this one? Three things:
• Our primary goal in writing this book is to make the topics we cover easy to understand.
• Demonstration programs called Workshop applets bring to life the topics we cover, showing you step by step, with "moving pictures," how data structures and algorithms work.
• The example code is written in Java, which is easier to understand than C,C++, or Pascal, the languages traditionally used to demonstrate computer science topics.
Let's look at these features in more detail.
[b]Easy to Understand[/b]
Typical computer science textbooks are full of theory, mathematical formulas, and abstruse examples of computer code. This book, on the other hand, concentrates on simple explanations of techniques that can be applied to real-world problems. We avoid complex proofs and heavy math. There are lots of figures to augment the text.
Many books on data structures and algorithms include considerable material on software engineering. Software engineering is a body of study concerned with designing and implementing large and complex software projects.
However, it's our belief that data structures and algorithms are complicated enough without involving this additional discipline, so we have deliberately de-emphasized software engineering in this book. (We'll discuss the relationship of data structures and algorithms to software engineering in Chapter 1," Overview.")
de-emphasize [di:'emfəsaiz] vt. 不再重视,不再强调
Of course we do use an object-oriented approach, and we discuss various aspects of object-oriented design as we go along, including a mini-tutorial on OOP in Chapter 1. Our primary emphasis, however, is on the data structures and algorithms themselves.
[b]Workshop Applets[/b]
The CD-ROM that accompanies this book includes demonstration programs, in the form of Java applets, that cover the topics we discuss. [u]These applets, which we call Workshop applets, will run on many computer systems, appletviewers, and Web browsers. (See the readme file on the CD-ROM for more details on compatibility.)[/u] The Workshop applets create graphic images that show you in "slow motion" how an algorithm works.
For example, in one Workshop applet, each time you push a button, a bar chart shows you one step in the process of sorting the bars into ascending order. The values of variables used in the sorting algorithm are also shown, so you can see exactly how the computer code works when executing the algorithm. Text displayed in the picture explains what's happening.
Another applet models a binary tree. Arrows move up and down the tree, so you can follow the steps involved in inserting or deleting a node from the tree. There are more than 20 Workshop applets—at least one for every major topic in the book.
These Workshop applets make it far more obvious what a data structure really looks like, or what an algorithm is supposed to do, than a text description ever could. Of course, we provide a text description as well. The combination of Workshop applets, clear text, and illustrations should make things easy.
These Workshop applets are standalone graphics-based programs. You can use them as a learning tool that augments the material in the book. (Note that they're not the same as the example code found in the text of the book, which we'll discuss next.)
standalone adj. 单独的
[b]Java Example Code[/b]
The Java language is easier to understand (and write) than languages such as C and C++. The biggest reason for this is that Java doesn't use pointers. Although it surprises some people, pointers aren't necessary for the creation of complex data structures and algorithms. In fact, eliminating pointers makes such code not only easier to write and to understand, but more secure and less prone to errors as well.
Java is a modern object-oriented language, which means we can use an object-oriented approach for the programming examples. This is important, because object-oriented programming (OOP) offers compelling advantages over the old-fashioned procedural approach, and is quickly supplanting it for serious program development. Don't be alarmed if you aren't familiar with OOP. It's not that hard to understand, especially in a pointer-free environment such as Java. We'll explain the basics of OOP in Chapter 1.
The Software You Need to Use this Book
All the software you need to use this book is included on the accompanying CD-ROM. To run the Workshop applets you need a Web browser or an appletviewer utility such as the one in the Sun Microsystems Java Development Kit (JDK). Both a browser and the JDK are included on the CD-ROM. To compile and run the example programs you'll need the JDK. Microsoft Windows and various other platforms are supported. See the readme file on the included CD-ROM for details on supported platforms and equipment requirements.