Sorting and 2d Arrays – Geometry – Problem #5
IIT Kharagpur CS10001 / CS11001 Programming and Data Structures Lab Question Archive
Difficulty: hard
Problem Statement
A three dimensional vector can be represented as a 1-D array containing three floating point values. Write a program which inputs a positive integer n from the user and then input n three dimensional vectors. The memory for storing these n vectors must be allocated dynamically. Now, compute the pairwise distance among these n vectors and store them in a n x n matrix. The memory for this matrix should also be allocated dynamically. Use can use the sqrt function in math.h