Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
differentation using C++
|
|||
|---|---|---|---|
|
#18+
I need urgent help in following problem. Please give me atleast and idea as how to implement it thanks in advance for your time I need to write a program that will differentiate expressions in the variable X. The input to this program will be a series, each representing an infix expression to be differentiated. Each such expressions is to be viewed as a stream of tokens. Valid tokens are integers, the variable X, the binary operators (+, -, *, /, ^), and parentheses. To make scanning for tokens easy, you may assume that each token is followed by exactly one space, with the exception of the final token, which is followed by the end of line character. First the program will have to scan the infix expression, building up an appropriate binary tree representation of it. Once the binary expression tree is built, traverse it, building up an other binary expression tree, which represents the derivative of the original expression. The following differentiation rules should be used in this process: Suppose C is a constant, and S and T are expressions in X: Diff (C) = 0 Diff (X) = 1 Diff (S + T) = Diff (S) + Diff (T) Diff (S - T) = Diff (S) - Diff (T) Diff (S * T) = S * Diff (T) + T * Diff (S) Diff (S / T) = ((T * Diff (S)) - (S * Diff (T))) / (T ^ 2) Diff (S ^C) = (C * S ^ (C - 1)) * Diff (S) Finally, once the binary expression tree for the derivative has been built, print the expression. Print it in completely parenthesized infix notation to avoid ambiguity. Note that there are three distinct phases to this problem: 1) Parsing of the original infix expression into a binary tree representation 2) Building a binary tree representation of the derivative 3) Printing the derivative in completely parenthesized infix notation. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2005, 19:46 |
|
||
|
differentation using C++
|
|||
|---|---|---|---|
|
#18+
Translate expression into RPN. It's stack form of expression: "a + b * c" -> "b c * a +" ________________________________________________________ Глюк - это высокоорганизованная система не поддающихся определению частиц ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2005, 20:16 |
|
||
|
differentation using C++
|
|||
|---|---|---|---|
|
#18+
I have done that already. But what should i do next? Let's say i have the function in a binary tree, what to do next??? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2005, 22:51 |
|
||
|
differentation using C++
|
|||
|---|---|---|---|
|
#18+
I have done that already. But what should i do next? Let's say i have the function in a binary tree, what to do next??? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.12.2005, 22:53 |
|
||
|
|

start [/forum/topic.php?fid=16&fpage=191&tid=1347216]: |
0ms |
get settings: |
10ms |
get forum list: |
15ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
44ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
40ms |
get tp. blocked users: |
1ms |
| others: | 267ms |
| total: | 399ms |

| 0 / 0 |
