Math, asked by koushikinukonda83, 9 months ago

the union of two rays withe one end point is​

Answers

Answered by jsailu27
6

Answer:

aray

plz like and follow me plz

Answered by nidhisharma96
1

Answer:

Method 1 (Naive)

Union:

1) Initialize union U as empty.

2) Copy all elements of first array to U.

3) Do following for every element x of second array:

…..a) If x is not present in first array, then copy x to U.

4) Return U.

Intersection:

1) Initialize intersection I as empty.

2) Do following for every element x of first array

…..a) If x is present in second array, then copy x to I.

4) Return I.

Time complexity of this method is O(mn) for both operations. Here m and n are number of elements in arr1[] and arr2[] respectively.

Similar questions