Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:12:29+00:00 2026-06-17T07:12:29+00:00

We have a (w times h) canvas (width w and height h), which is

  • 0

We have a (w times h) canvas (width w and height h), which is used as a drawing area. We can define ‘maps’ or regions in the drawing area, on which the user can click to perform some pre-defined tasks. Each region is defined by a bounding rectangle. An image-map is activated when the user clicks inside it. Two regions may have overlapping rectangles. Whenever the user clicks on a point the canvas, we are required to find the find the image-map(s) to which the point belongs and start the execution of the corresponding task. We can always use a linear list to find the image-maps. But is there a better way, a data structure that could be used to store the image maps so that we can figure out efficiently (in less than O(n) time) which image-maps are activated on user click?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:12:30+00:00Added an answer on June 17, 2026 at 7:12 am

    Yes – use any type of 2D spatial index. The most common is the quad-tree, which has O(log(n)) lookup complexity and is also quite quick to build. Implementations are available in all major languages; it is extensively used for all types of mapping applications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a drawing using canvas which I intend to use multiple times for
Is this possible? In an events system an event can have multiple times. (ie,
EDIT: my revised Entity relationship diagram A Student can have many contact times but
In my WPF project I have a canvas on which I draw an ellipse
Let's say I have a canvas with a fixed height and a vertical scroll
I have a WPF app with an image over which is laid a user
I have two times in PHP and I would like to determine the elapsed
How many times have you seen someone trying to Log the command I run
I have searched through many times but have not seen this before. Probably really
I have exported many times tables from Hive to SQL Server. I never face

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.