How can we understand what data structure is needed?

Suppose I am trying to develop an algorithm to solve a problem.

How should I proceed?

How can I understand which data structure is suitable for solving my problem?

When trying to develop an algorithm for evaluating an infix expression, I thought it would be wise to use two stacks to solve the problem. But later I discovered that a tree is necessary for this work.

How did the developer know that the tree would be suitable?

+3
source share
3 answers

. . AI, Lisp , . ( s-, ).

, , . ( - , -, - , ?) , .

+2

: .

: , .

, , .

, .

0

Firstly, to correctly understand the situation, and then think about what is most suitable for this problem. A suitable tool that is fast and takes up less memory.

0
source

All Articles