29 Jun 2019

Next Greater Element

Problem Statement:
      Print the next greater element to every element in an array , if no greater element exists for a number
 print -1.

Given Array :   7     22    4      12     25      3      9
Output:            22   25    12    25     -1      9      -1

Solution:

The above problem can be solved using stack.

Below is the sub-routine implementation:
Please comment and post suggestions
Happy Coding !! :)

7 comments:

  1. Smaller exhibits, including tables, kiosks and a few portable and modular
    inline displays, are beneficial for companies that desire a
    high-quality exhibit with consistent brand presentation at budget-friendly prices.

    If you currently have a trade event booth designed, have it ready for a full analysis.

    In short, it's crucial for organizations to ensure they
    deliver enough exciting details to pique the crowd's interest
    without crossing the fishing line into the dreaded very real problem
    territory.

    My blog post; cheap exhibits trade show

    ReplyDelete
  2. These be able to hold 50% excess fat than a standard slatwall.
    If your unit is not modular, contact the organization before you make
    any structural changes. Visit your customers' Facebook pages and personally invite
    these to stop by and visit your display displays and banner stands.



    Also visit my web-site convention booth store

    ReplyDelete
  3. Appreciation to my father who stated to me on the topic of this weblog, this
    blog is really awesome.

    Visit my website ... uk charter flights

    ReplyDelete
  4. I would like to thank you for the efforts you've
    put in writing this website. I really hope to view the
    same high-grade content from you later on as well.
    In fact, your creative writing abilities has inspired me to get my own, personal website now ;)

    my page ... charter flight uk

    ReplyDelete
  5. Thanks for any other great article. The place
    else may anybody get that kind of info in such a perfect manner of writing?
    I have a presentation next week, and I am at the look for such information.

    my weblog :: first company

    ReplyDelete
  6. wonderful points altogether, you just received a logo new reader.
    What may you recommend in regards to your put up that you simply made some days ago?
    Any positive?

    My site: home based business

    ReplyDelete
  7. Hello, I read your blogs regularly. Your
    writing style is awesome, keep doing what you're doing!



    Also visit my website; private jet sales uk

    ReplyDelete