Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Mishco/99-problems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

99 Problems in Java

Overview

Build Status Quality Gate Status Coverage

This is an adaptation of the Ninety-Nine Prolog Problems written by Werner Hett at the Berne University of Applied Sciences in Berne, Switzerland.

From the original source:

The purpose of this problem collection is to give you the opportunity to
practice your skills in logic programming.
Your goal should be to find the most elegant solution of the given problems.
Efficiency is important, but logical clarity is even more crucial.
Some of the (easy) problems can be trivially solved using built-in predicates.
However, in these cases, you learn more if you try to find your own solution.
The problems have different levels of difficulty.
Those marked with a single asterisk (*) are easy.
If you have successfully solved the preceding problems you should be able
to solve them within a few (say 15) minutes.
Problems marked with two asterisks (**) are of intermediate difficulty.
If you are a skilled Java programmer it shouldn't take you more
than 30-90 minutes to solve them.
Problems marked with three asterisks (***) are more difficult.
You may need more time (i.e. a few hours or more) to find a good solution.

The main purpose for this repository is to train Java skills and also deepen TDD skills Test Driven Development.

Technology

Problems

Lists

Arithmetic

P29 - Determine whether a given integer number is prime.

P30 - Determine the prime factors of a given positive integer.

P31 - Determine the prime factors of a given positive integer (2).

P32 - A list of prime numbers.

P33 - Goldbach’s conjecture.

P34 - A list of Goldbach compositions.

P35 - Determine the greatest common divisor of two positive integer numbers.

P36 - Calculate Euler’s totient function phi(m).

P37 - Calculate Euler’s totient function phi(m) (2).

P38 - Compare the two methods of calculating Euler’s totient function.

Logic and Codes

P39 - Truth tables for logical expressions.

P40 - Truth tables for logical expressions (2).

P41 - Truth tables for logical expressions (3).

P42 - Gray code.

P43 - Huffman code.

Binary Tree

P44 - Check whether a given term represents a binary tree

P45 - Construct completely balanced binary trees

P46 - Symmetric binary trees

P47 - Binary search trees (dictionaries)

P48 - Generate-and-test paradigm

P49 - Construct height-balanced binary trees

P50 - Construct height-balanced binary trees with a given number of nodes

P51 - Count the leaves of a binary tree

P52 - Collect the leaves of a binary tree in a list

P53 - Collect the internal nodes of a binary tree in a list

P54 - Collect the nodes at a given level in a list

P55 - Construct a complete binary tree

P56 - Layout a binary tree (1)

P57 - Layout a binary tree (2)

P58 - Layout a binary tree (3)

P59 - A string representation of binary trees

P60 - Preorder and inorder sequences of binary trees

P61 - Dotstring representation of binary trees

Multiway Trees

P62 - Check whether a given term represents a multiway tree

P63 - Count the nodes of a multiway tree

P64 - Tree construction from a node string

P65 - Determine the internal path length of a tree

P66 - Construct the bottom-up order sequence of the tree nodes

P67 - Lisp-like tree representation

Graphs

P68 - Conversions

P69 - Path from one node to another one

P70 - Cycle from a given node

P71 - Construct all spanning trees

P72 - Construct the minimal spanning tree

P73 - Graph isomorphism

P74 - Node degree and graph coloration

P75 - Depth-first order graph traversal

P76 - Connected components

P77 - Bipartite graphs

P78 - Generate K-regular simple graphs with N nodes

Miscellaneous

P79 - Eight queens problem

P80 - Knight’s tour

P81 - Von Koch’s conjecture

P82 - An arithmetic puzzle

P83 - English number words

P84 - Syntax checker

P85 - Sudoku

P86 - Nonograms

P87 - Crossword puzzle (the last P99 in some sources)