Skip to content

Jaytechent/Data-Structure-Algorithm-checkpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Data-Structure-Algorithm-checkpoint

Problem 1 Explanation:

The procedure FindDistinctSum takes two sets (set1 and set2) as input parameters.

It initializes sum to 0.

It then iterates through each element of set1, checking if it's present in set2. If not, it adds that element to sum.

It then repeats this process for set2 with respect to set1.

Finally, it prints out the calculated sum.

The calculated sum is the sum of the distinct value of the two sets of arrays

Problem 2

Explanation:

The procedure DotProduct calculates the dot product of two vectors (v1 and v2) and stores the result in the VAR ps.

It uses a nested loop to iterate through the elements of v1 and v2 to perform the dot product calculation.

In DetermineOrthogonalVectors, it reads the number of vector pairs (n).

It then iterates through each pair, reading the vectors (v1 and v2).

It calculates the dot product using the DotProduct procedure.

Finally, it checks if the dot product is zero (indicating orthogonal vectors) and prints the result.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors