Beginning from the triassic era, dinosaurs crawled for millions of years. So my basic idea is, that had the dinosaurs not been wiped out, they would have eaten all the flora on the planet then. Because : 1)They (herbivore giants like brachiosaurus, triceratops etc) didn't have any predator. So population growth. 2)they must have had a great requirement of food for one day. (think of an elephant who has to eat a tenth of its way) Doesn't All of this sum up to speak that nature found a way to save the biosphere (then) by extincting them?
Basic misunderstand about how one can make sense of nature
Nature is not a conscient being (or at least not falsifiable conscient being) trying to optimize the amount of flora or whatever you would like to optimize. There is no conscious will in the processes of evolution, in the course of a meteorite or in the decay rate of some radioactive material. Things just happen through causality (and eventually pure randomness when you go to quantum physics), not because there is a wish for this thing to happen.
So, in short no, dinosaurs did not get extinct because someone thought it would be better this way.
This discussion is not a matter of science but of philosophy of science and philosophy of knowledge. You can further this discussion on Philosophy.SE, they will be much better than me at addressing this misunderstanding.
Dinosaurs did not really get extinct
By the way, dinosaurs did not really get extinct as birds are dinosaurs. The number of dinosaurs lineages just suddenly (sudden in terms of geological time at least) decreased.
Loosely related to that, you might want to have a look at the post If dinosaurs could have feathers, would they still be reptiles?
For how long were dinosaurs there?
Dinosaurs (excluding aves, that is the lineage giving rise to modern birds) have roamed the earth from 226 millions years ago to 65 millions years ago (period called the Mesozoic). There is much more time separating the Plateosaurus (late Triassic; ~210 millions years ago) to the Triceratops (late Creaticious; ~68 millions years ago) than between the Triceratops and the first Homo sapiens (~250 thousands years ago). Dinosaurs have been around for long enough so that we can consider that they were not just eating all the plants!
As you assumed that predator population would just grow indefinitely in absence of preys, you might want to have a look at What prevents predator overpopulation?.