Ideas and methods for solving problems

Source: Internet
Author: User

Many students asked me this question and used a question (or actually a question) to solve it. In fact, human thinking is the most difficult to describe. Each person has different ways of thinking and habits. The same is true for solving the same problem. To put it simply, it is difficult to give a single model of "thinking", but many methods have been summarized by our predecessors. The following lists my commonly used solutions and ideas for your reference.



Blog address: http://blog.csdn.net/duzixi


Let's talk about the idea of disintegration first.

There are two basic approaches to disbanding: one is "top-down" and the other is "bottom-up ".


Top-down:

To put it simply, "top-down" means to first consider the problem as a whole, and clarify what the relationship between each part is, then it is refined and implemented layer by layer.


This routine applies to the following scenarios:

This type of problem is basically similar.

A project is completed by multiple people and requires a proper division of labor in advance.

The relationship between problem components is relatively simple


Bottom-up:

"Bottom-up" is opposite to "top-down", that is, to do a good job in a specific part first, and then establish a relationship between them to form a whole.


The second method is applicable to the following scenarios:

There are a lot of unknown issues, and it's confusing to solve them.

The relationship between the components of the problem is complex and cannot be understood at the moment.


Some problems are highly unknown. Such unknowns may be for individuals, or for the whole of humans. In any case, when you are not sure how to do one thing, you may wish to proceed with the work you can do first, sometimes the idea is opened with these implementations. In the beginner stage (with less than one year of programming language experience), it is impossible to think about a complicated problem and try again. It is the first natural enemy to hold you down.


At the stage of learning new knowledge, the least fear is wrong and detours.


In fact, these two routines are not as simple as they are. In some practical problems, you will find that the two ideas work together. How to Choose and cooperate varies from person to person.



Next, let's list the solution:


Decomposition Method:Split big problems into multiple small problems and solve them one by one

The decomposition method is a favorite method by engineers. Especially when engineering objects (software engineers are a piece of software) are relatively large and complex, they must be divided into several parts by means of decomposition.

If it is a process-oriented programming method, it is necessary to break down into several modules by function, and then use functions to implement these modules. Then, call the API in the order and steps of solving the problem.

If it is an object-oriented programming method, it needs to be encapsulated by class, implement class behavior one by one using methods, and then provide external interfaces for other classes to call.


Plotting: visualizes problems on paper, freeing up more memory for thinking.

This method was taught by osai song, a primary school mathematics teacher. She said that the plotting method can solve the vast majority of problems. At that time, I especially liked painting, so I also liked using this method to solve the problem.

The plotting method can make the problem "clear at a glance ". If a person is more accustomed to image thinking, this method will be very effective.

A graph can express the content that is hard to describe by natural language.

There are many mature "XX diagram" modes, flowcharts, class diagrams, better decomposition diagrams, page Jump diagrams, and other auxiliary development in software development.

However, the effectiveness of the plotting method is not limited to this. You can use a self-designed diagram to describe a problem.

If the picture is accurate enough, it can even help you complete the computation.


Example:

(1) typical questions in the C language loop section: the ball is launched and then popped up.

(2) When I am working on a very visual algorithm such as cellular layout, I will first use an automatic pencil to figure out the calculation formula on the paper, and then write and debug it with code.


Stripping Method:First, implement the core functions and then improve them one by one

When developing a project, beginners often encounter the following embarrassing problem: Many auxiliary functions are well implemented, and the core functions cannot be implemented.

From the perspective of software engineering, this method may be more like the "Prototype Method ". First, implement the most basic and core content, and then gradually improve other content.


Test method:"Practice is the only criterion for verifying truth"

Prerequisites: Poor

Applicable situations: lack of relevant documents, unclear instructions, and insufficient understanding

For example, you can directly view the header file and guess the purpose. You can use the header file based on the parameter and return value type.


Enumeration Method:

What makes the effort easy and enjoyable? -- Loop

What makes it easy for computers to defeat humans? -- Loop


For a simple structure (single array, dictionary, and set), you only need to use a loop statement to solve the problem. The nesting of arrays, dictionaries, and sets can be done with multiple nested loop statements.


For a slightly more complex structure, such as a tree, you need to traverse through deep search or wide search.




In addition to routines and methods, my personal favorite way of thinking isPoint PresentationIt is the best to feel inspired to flash and shuttle in the knowledge network.


Finally, I ended this blog post with a sentence:

"There is no idea in this world. If there are too many people to think about it, it will become the road ."


Ideas and methods for solving problems

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.