Question

Given two d-dimensional MBRs, E1 = (x1min, x1max; x2min, x2max; …; xdmin, xdmax) and E2 =...

Given two d-dimensional MBRs, E1 = (x1min, x1max; x2min, x2max; …; xdmin, xdmax) and E2 = (y1min, y1max; y2min, y2max; …; ydmin, ydmax) (note: both E1 and E2 are represented by an array in the code), please give the pseudo code to check whether or not two MBRs are intersecting with each other. If yes, please return true; otherwise, return false. [20 points]

Any programming language is fine.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a = [10, 20, 50, 60, 70, 80]
b = [5, 9, 40, 49]
t = 0
for i in range(0, min(len(a), len(b)), 2):
if b[i] in range(a[i], a[i+1] + 1) or b[i+1] in range(a[i], a[i+1] + 1):
print(True)
t = 1
break
if t== 0: print(False)

Add a comment
Know the answer?
Add Answer to:
Given two d-dimensional MBRs, E1 = (x1min, x1max; x2min, x2max; …; xdmin, xdmax) and E2 =...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In pseudocode only Design (pseudocode) a program (name it Occurrences) to determine whether two two-dimensional arrays...

    In pseudocode only Design (pseudocode) a program (name it Occurrences) to determine whether two two-dimensional arrays are equivalent or not. Two arrays are equivalent if they contain the same values in any order. The program main method defines two two-dimensional array of size 3-by-3 of type integer, and prompts the user to enter integer values to initialize the arrays. The main method calls method isEquivalent()that takes two two-dimensional arrays of integer and returns true (boolean value) if the arrays contain...

  • C++Implement only (source code) a program to determine whether two two-dimensional arrays are equivalent or not....

    C++Implement only (source code) a program to determine whether two two-dimensional arrays are equivalent or not. Two arrays are equivalent if they contain the same values in any order. The program main method defines two two-dimensional array of size 3-by-3 of type integer, and prompts the user to enter integer values to initialize the arrays. The main method calls method isEquivalent()that takes two two-dimensional arrays of integer and returns true (boolean value) if the arrays contain the same values in...

  • I am unsure how to add the following methods onto this code?? please help - rowValuesIncrease(int[][]...

    I am unsure how to add the following methods onto this code?? please help - rowValuesIncrease(int[][] t) A method that returns true if from left to right in any row, the integers are increasing, otherwise false. - columnValuesIncrease(int[][] t) A method that returns true if from top to bottom in any column, the integers are increasing, otherwise false. - isSetOf1toN(int[][] t) A method that returns true if the set of integers used is {1, 2, . . . , n}...

  • c++ show code thanks, only use library <iostream> Question 1 Write the following two functions The...

    c++ show code thanks, only use library <iostream> Question 1 Write the following two functions The first function accepts as input a two-dimensional array of integers. It returns two results: the sum of the elements of the array and the average The second function accepts as input a two-dimensional array of integers and integer value V. It returns true if the value V is found in the array, false otherwise. Write a main program that declares and initializes the following...

  • 1)def toggle_cell(row, column, cells): • Return value: Flip the cell in the column of row from...

    1)def toggle_cell(row, column, cells): • Return value: Flip the cell in the column of row from alive to dead or vice versa. Return True if the toggle was successful, False otherwise. • Assumptions: o cells will be a two-dimensional list with at least one row and one element in that row. o row and column are index values of cells • Notes: o Cells is being edited in place. Note that the return value is a Boolean and not a...

  • Which of the following reactions will undergo an E1 reaction faster? Question 2 Not yet answered...

    Which of the following reactions will undergo an E1 reaction faster? Question 2 Not yet answered Points out of 1.0 P Flag question (a) C (b) (c) (d) Select one: O a. (a) 1-bromopentane O b. (b) E-1-bromo-1-pentene c. (C) 3-methyl-3-bromopentane O d. (d) 3-methyl-3-bromo-1-pentene O e. The two fastest of these will have exactly the same rate constant. True or false: When both an SN2 and an E2 reaction are possible, increasing the temperature of the reaction will speed...

  • Part II. (4 pts) Given the axiom set for the Incidence Geometry as below: Undefined terms: point, line, on Definitions: 1. Two lines are intersecting if there is a point on both. 2. Two lines are...

    Part II. (4 pts) Given the axiom set for the Incidence Geometry as below: Undefined terms: point, line, on Definitions: 1. Two lines are intersecting if there is a point on both. 2. Two lines are parallel if they have no point in common. Axioms: I. Given any two distinct points, there is a unique line on both. II. Each line has at least two distinct points on it. III. There exist at least three points. IV. Not all points...

  • C programming 1) When setting a two-dimensional character array, how is the size (number of characters)...

    C programming 1) When setting a two-dimensional character array, how is the size (number of characters) in the second dimension set? Select an answer: The number of elements are equal to the average size of all the strings. To the length of the longest string; you don't need to add one because the first array element is zero. To the length of the longest string, plus one for the null character. The second dimension is equal to the number of...

  • ASSEMBLY LANGUAGE The matrix (two-dimensional array) with ROWS and COLS dimensions of integer values is given....

    ASSEMBLY LANGUAGE The matrix (two-dimensional array) with ROWS and COLS dimensions of integer values is given. Perform various matrix processing activities according to the algorithms below. Store the results into the output vector (one-dimensional array) with appropriate size. For Grade 7) Count the number of odd values (n mod 2 <> 0) for each row. For Grade 9) Calculate the sum of positive values for each column. To obtain inputs and return the results, define appropriate type C/C++ functions. Please...

  • IN PYTHON ONLY !! Design (pseudocode) and implement (source code) a program (name it Occurrences) to...

    IN PYTHON ONLY !! Design (pseudocode) and implement (source code) a program (name it Occurrences) to determine whether two two-dimensional arrays are equivalent or not. Two arrays are equivalent if they contain the same values in any order. The program main method defines two two-dimensional array of size 3-by-3 of type integer, and prompts the user to enter integer values to initialize the arrays. - The main method calls method isEquivalent()that takes two two-dimensional arrays of integer and returns true...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT