wishgale / AlgoXY

Book of Elementary Algorithms and Data structures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elementary Algorithms

Edition: $\displaystyle e = \sum \limits _{n=0}^{\infty }{\frac {1}{n!}} = 1 + {\frac {1}{1}}+{\frac {1}{1\cdot 2}}+{\frac {1}{1\cdot 2\cdot 3}}+\cdots = 2.718283$

2023/04

This book introduces about elementary algorithms and data structure. It includes side-by-side comparison about purely functional realization and their imperative counterpart.

Contents

I am adding exercises and answers to the second edition from 2023/03. I wrote the first edition from 2009 to 2017, then rewrote from 2020 to 2023. The PDF can be downloaded for preview (EN, 中文). The 1st edition in Chinese (中文) was published in 2017. I recently switched my focus to the Mathematics of programming, the new book is also available in (github)

  • Preface
  • Chapter 0, List;
  • Chapter 1, Binary Search Tree;
  • Chapter 2, Insertion sort;
  • Chapter 3, Red-black tree;
  • Chapter 4, AVL tree;
  • Chapter 5, Radix tree, Trie and Prefix Tree;
  • Chapter 6, B-Trees;
  • Chapter 7, Binary Heaps;
  • Chapter 8, Selection sort;
  • Chapter 9, Binomial heap, Fibonacci heap, and pairing heap;
  • Chapter 10, Queue;
  • Chapter 11, Sequence;
  • Chapter 12, Divide and conquer sort;
  • Chapter 13, Search;
  • Appendix and answers

Install

To build the book in PDF format from the sources, you need the following software pre-installed.

  • TeXLive, The book is built with XeLaTeX, a Unicode friendly version of TeX;

Install TeXLive

In Debian/Ubuntu like Linux environment, do NOT install the TeXLive through apt-get. Go to TeXLive official site to download the setup script.

$ wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip
$ unzip install-tl.zip
$ cd install-tl
$ sudo ./install-tl -gui text -repository http://mirror.ctan.org/systems/texlive/tlnet

In Windows, TeXLive provide a gui based installer, in Mac OS X, there's a MacTeX.

Install ImageMagick and Graphviz

$ sudo apt-get install imagemagick
$ sudo apt-get install graphviz

For Windows and Mac OS X installer, ImageMagick can be download through http://www.imagemagick.org; Graphviz can be download from: http://graphviz.org

Others

You need the GNU make tool, in Debian/Ubuntu like Linux, it can be installed through the apt-get command:

$ sudo apt-get install build-essential

In Windows, you can install the MSYS for it. In Mac OS X, please install the developer tool from this command line:

$ xcode-select --install

Build the book PDF

enter the folder contains the book TeX manuscript, run

$ make

This will generate algoxy-en.pdf and algoxy-zh-cn.pdf. If you only need the Chinese version for example, you can run make cn instead. Run make force-cn or make force-en to force build the book.

--

LIU Xinyu

liuxinyu95@gmail.com

About

Book of Elementary Algorithms and Data structures


Languages

Language:TeX 67.1%Language:Python 8.0%Language:Haskell 7.5%Language:C++ 5.2%Language:Java 3.8%Language:C 3.5%Language:Scheme 2.1%Language:Scala 1.5%Language:Makefile 0.7%Language:Shell 0.5%Language:Perl 0.0%