Algorithm Example Writing By Java