by Randal L. Schwartz and Tom Phoenix
ISBN 0-596-00132-0
Third Edition, published July 2001.
(See the catalog page for this book.)
the text of Learning Perl, 3rd Edition.
Table of Contents
Copyright Page
Preface
Chapter 1: Introduction
Chapter 2: Scalar Data
Chapter 3: Lists and Arrays
Chapter 4: Subroutines
Chapter 5: Hashes
Chapter 6: I/O Basics
Chapter 7: Concepts of Regular Expressions
Chapter 8: More About Regular Expressions
Chapter 9: Using Regular Expressions
Chapter 10: More Control Structures
Chapter 11: Filehandles and File Tests
Chapter 12: Directory Operations
Chapter 13: Manipulating Files and Directories
Chapter 14: Process Management
Chapter 15: Strings and Sorting
Chapter 16: Simple Databases
Chapter 17: Some Advanced Perl Techniques
Appendix A: Exercise Answers
Appendix B: Beyond the Llama
Index
Colophon
by Randal L. Schwartz and Tom Phoenix
ISBN 0-596-00132-0
Third Edition, published July 2001.
(See the catalog page for this book.)
Learning Perl, 3rd Edition.
Table of Contents
Copyright Page
Preface
Chapter 1: Introduction
Chapter 2: Scalar Data
Chapter 3: Lists and Arrays
Chapter 4: Subroutines
Chapter 5: Hashes
Chapter 6: I/O Basics
Chapter 7: Concepts of Regular Expressions
Chapter 8: More About Regular Expressions
Chapter 9: Using Regular Expressions
Chapter 10: More Control Structures
Chapter 11: Filehandles and File Tests
Chapter 12: Directory Operations
Chapter 13: Manipulating Files and Directories
Chapter 14: Process Management
Chapter 15: Strings and Sorting
Chapter 16: Simple Databases
Chapter 17: Some Advanced Perl Techniques
Appendix A: Exercise Answers
Appendix B: Beyond the Llama
Index
Colophon
Implemented BFS, DFS and A*
To compile this project, use the following command:
g++ -o search main.cpp
Then you can run it:
./search
The input is loaded from a input file in.txt
Here is the format of the input file:
The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm.
The second line of input file shoud be an integer m indicate the number of connections for the map.
Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist.
The following input are for A*
The following line contains two chars indicate the source and destination city for A* algorithm.
Then there is an integer h indicate the number of heuristic.
The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.