Question: Define the struct vector with the following data members: length of type integer, norm of type double and elements[] a one dimensional array of type

Define the struct vector with the following data members: length of type integer, norm of type double and elements[] a one dimensional array of type double. The norm of a vector v = (V1, V2, ---, Un) is defined as ||0||2 = /v} + v + ... + vz. Implement the following functions: void print(vector); // to print the vector. void norm2 (vector); // to find norm 2 of the vector!!! bool equalVectors(vector, vector); // to check if tow vectors are equal. The following program produces the given sample of input/output: int main() { vector vL, VR; int i; cout > VL.length; cout > vL.elements[i]; cout > VR.length; cout > VR.elements[i]; norm2(VL); norm2(VR); print(VL); print(VR); if(equalVectors(VL, VR)) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
