Jump to content

Encrypted

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Encrypted's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well, the graph would look like this: The "+" means a square and the "O" means empty area. Basically, the red area is the rectangle. It's kind of hard to explain it so that everyone else would understand it, but I believe the graph explains it well enough. That is the largest rectangle by area possible with this kind of data. It doesn't matter that one of the lines is valued 5, it still contains the 3 at the bottom necessary to construct that rectangle.
  2. Well, yeah, as it seems, I have difficulties in explaining things in English. Sorry about that. By "largest possible rectangle" I meant the largest rectangle by area. So, with $array = array(3, 5, 3, 1, 7); the area would be 3*3 = 9 from the first 3 elements of the array. Edit: I thought of looping it and finding out all different areas, which are interpreted as rectangles, but it would take forever if you have several thousands of vertical lines with their vertical length being maximally 100. I was wondering, if it is possible to develop a quicker solution for this kind of a problem and if is, then what do you suggest me to do?
  3. Hmm, actually no. I don't have to find the area of all the squares together. I need to find the size of the largest possible rectangle, just like the graph in my first post shows. The red area is the part I need the area for. The main problem is how to find the amount of squares in the largest possible rectangle, the rest is easy as pi(e). The data is always different. That's why I need to build a program. So, the functions should be as algebraic as possible.. Edit: I just noticed the first post's last graph with the colored pluses doesn't contain the top line. Please note that it is in the graph above that and that the plus in the top line is still black.
  4. Hi! Let's say we have a bunch of numeric data. Example: Each of the numbers represents a vertical line containing exactly that many "squares" that have a certain measure. Each of the vertical lines' widths is exactly one square. So, this means, that the first line is 3 squares in area, the second one 1, the 3rd 5 and the 4th 4. Supposedly the lines are put together like this: (Note: I do not have to draw the graph) So, the problem I am trying to solve is, how to find the maximum area of a rectangle with this kind of data. In this case, it would be 8 squares: I've been trying to solve this problem for days, but am still kind of stumped. Is there a quick function to do this or do I have to make one up myself? If the latter is the case, how would it be best to do this? Thank you in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.