A few interesting algorithmic topics

Source: Internet
Author: User

These two days rushed to participate in two school recruit interview, there are many very interesting algorithm topics, some even did not find the best answer, more open algorithm design topics. In fact, the interview is not just algorithmic communication, which is interspersed with a variety of non-technical issues, unprepared, do not know how to show their own.

seemingly mathematical reasoning for programming problems:

A box has 100 white balls, 100 black balls, each time from the box does not put back the two ball, if the two balls are obtained is the same color, put a white ball, if the two balls to get a different color, put a black ball? What is the probability of leaving a black ball in the last box?

Expansion: A box with M white ball, n black Ball, according to the above scheme, the last box is the probability of remaining a black ball?

The old bottle was loaded with a new wine question:

The merge sort should be well understood, but after describing the idea, the interviewer might say you're going to implement an iterative version of the merge sort?

There's a water tank in the Leetcode,

Given n non-negative integers representing an elevation map where the width of each bar are 1, compute how much WA ter It is the able to trap after raining.

For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1] , return 6 .

Time complexity O (n), Three-pass algorithm is more easily thought of, one-pass algorithm?

A few interesting algorithmic topics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.