Programming Ideas
Would you like to take your programming skills to the next level? Are you looking for ideas on what to program next? Have you outgrown the simple toy programs discussed in most programming books? In this case, Programming Ideas might be the book for you.Programming Ideas is based on the notion that reading and writing real programs is the only way to master programming. Therefore, instead of teaching you how recursion works in theory, the book demonstrates a wide range of practical applications, from drawing fractals and geometric curves to multiplying arbitrarily large integers. The same approach is used to illustrate many other concepts such as backtracking, graph algorithms, functional programming, encoding data using bits, hashing, and computer arithmetic. All topics are illustrated using complete, working Java programs.The book was designed specifically for self-learners: every chapter includes a wide range of exercises and programming projects, usually with complete solutions.Free sample chapters Front Matter Chapter 1 Chapter 6 Back Matter Table of Contents Iterated Function Systems. To illustrate the power of programming, this first chapter demonstrates how to generate fascinating fractal images using a combination of iteration, linear interpolation, and matrix multiplication. The Mandelbrot Set. This chapter covers advanced applications of iteration. It explains the famous Mandelbrot set and how to create colorful images of any part of it. Growing Trees. In this chapter we turn to recursion and learn how it can be used to model and draw complex tree-like shapes such as the Pythagoras tree. Recursive Curves. Trees aren't the only objects with a recursive structure; here, we look at the Hilbert curve, a one-dimensional curve that converges toward a square, and Bézier curves, which are widely used in computer graphics. Bit Basics. In the following chapters, we will use bits and bit operations to conserve memory and speed up common operations. This chapter explains how bits work and how to make efficient use of them. Exploring Peg Solitaire. In this chapter, we study the classic game Peg Solitaire: how to store the game state using bits, how to simulate moves, and how to find and count all possible solutions. Traversing Graphs. Graphs and elementary algorithms such as breadth-first search can be used to model and analyze many popular puzzles. In this chapter, we show how to do this for so-called decanting problem, in which containers of a fixed size must be used to measure liquid. Sokoban and Path Finding. As a more advanced example of graphs and graph algorithms, this chapter discusses how to solve levels of the computer game Sokoban. We use Dijkstra's algorithm to find the solution that requires the smallest number of steps. Encoding Information. Efficiently encoding information at the level of bits and bytes is essential for many file formats and network protocols. This chapter explains the basics of binary codes and Huffman coding. Lempel-Ziv Compression. Building on the previous chapter, we explain how data compression in programs like ZIP or RAR works. We explain the LZ77 algorithm, its implementation, and several ways to encode its output as a stream of bits. Big Integers. A fundamental limitation of computers is that their numbers have a fixed length, usually 32 or 64 bits. This final chapter explains how to store and compute with arbitrarily large integers.
Get it → danielheck.gumroad.com