Summary: This website contains the source codes used in the book. The source codes will help you get started quickly with the data structures and algorithms written in C++. In addition to the source codes, you will find some supplementary information including book errata and release notes.
Note: The purpose of the C++ programs shown in this site have been implemented only for the algorithms and problems written in the book. Therefore, please read first the book and use the source codes to understand the respective subject and chapter. The source code had been originally written and compiled by g++ v2.8 (GNU C++ Compiler) in 2000. Due to C++ new standards, some of original source codes are not supported by latest C++ compilers. Therefore, the source codes have been updated and compiled by g++ v8.1 (GNU C++ Compiler) in 2022. Please see the Release notes.
Source codes
Follow these instructions to compile the source codes.
1. GNU Compiler Collection
Download C++ compiler
- First, download The GNU Compiler Collection (GCC) from the GNU GCC.
- Install GCC on your computer according to the instruction from the installation package.
Compile the source code using C++ compiler
- Copy/Paste the source code in the text editor (vi in Unix/Linux, Notepad in Windows), and save as C++ program with .cpp extention.
- Then compile the .cpp source code and run as:
g++ quick_sort.cpp -o quick_sort.exe
quick_sort.exe
2. Online compilers
There are many online C++ compilers available on the Internet. Online compilers can be useful tools to quickly compile the source codes without having to install a proper compiler on your computer. You can use the link to open OnlineGDB compiler in the top navigation bar from any chapter.
Acknowledgments
Much gratitude to Demnel NGO for being a sponsor of the web hosting and the latest edition of the book publishing. Many people gave me helpful feedback on earlier versions of this book.
Feedback
Please email any comment or question to dsacpp(at)ict.demnel.org or use the Feedback link in the top navigation bar.
Otgonbayar Tovuudorj
