[Exercise 6] [Content] [Exercise 8]

Exercise 7


Task 7.1

Create a program which represents points in the 3D space. Declare struktured data type for points representation. Define two functions:

  1. float distance(...), which has one parameter (point) and returns distance of the point from he origin.
  2. float distance(...), which has two parameters (two points) and returns distance between two points.
Read coordinates from the standard input, store them into variables of the above defined structured data type. Verify the behaviour of your functions.

Solution:

CodeBlocks:points_3D.cbp, points_3D.cpp


Task 7.2

Create a recursive version of Binary Search

Prepared code:
CodeBlocks:bin_search_rec_prepared.cbp, bin_search_rec_prepared.c

Solution:

CodeBlocks:bin_search_rec.cbp, bin_search_rec.c


[Exercise 6] [Content] [Exercise 8]