☰
↑
←
→
🔍
TOC
P-99: Ninety-Nine Prolog Problems
»
Table of Contents
ON THIS PAGE
Introduction
Working with Prolog lists
Last element of a list
Last but one element of a list
Find element in a list
Number of elements of a list
Reverse a List
Palindrome
Flatten a list
Eliminate duplicates
Pack consecutive duplicates
Run-length encoding
Run-length decoding
Duplicate the Elements of a List
Duplicate the elements of a list a given number of times
Drop every N'th element from a list.
Split a list
Extract a slice from a list
Rotate a list
Remove an element from a list
Insert an element into a list
Creating lists
Generate combinations
Grouping elements of a list
Sort a list of lists
Arithmetic
Is it prime?
Greatest common divisor
Coprimes
Euler's totient function
Prime factors
Euler's totient function (improved)
Comparing Euler's totient function's methods
List of prime numbers
Goldbach's conjecture
List of Goldbach compositions
Logic and Codes
Truth tables
Gray code
Huffman code
Binary Trees
Is it a binary tree?
Balanced binary trees
Symmetric binary trees
Binary search trees (dictionaries)
Generate-and-test paradigm
Height-balanced binary trees
Leaves of a binary tree
Nodes of a binary tree
Complete binary tree
Layout a binary tree
String representation
Preorder and inorder
Dotstring representation
Multiway Trees
Is it a multiway tree?
Number of nodes
Tree construction
Internal path
Bottom-up order sequence
Lisp-like tree representation
Graphs
Conversions
Path
Cycle
Spanning trees
Node degree and graph coloration
Miscellaneous Problems
Eight queens problem
Knight's tour
Arithmetic puzzle
K-regular simple graphs
English number words
Nonograms
Table of Contents