Für Vorlesungen, bitte die Webseite verwenden. https://flavigny.de/lecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8KB

  1. \documentclass{../../../lecture}
  2. \newcommand{\te}[1]{\underline{#1}}
  3. \begin{document}
  4. \begin{aufgabe}[Darstellung von binären Bäumen]
  5. \end{aufgabe}
  6. \textbf{a)}
  7. \textit{Preorder}: +(*(:(8 3) 7) -(4 *(+(1 5) 2)))\\
  8. \textit{Inorder}: (((8 : 3) * 7) + (4 - ((1 + 5) * 2)))\\
  9. \textit{Postorder}: (((8 3): 7)* (4 ((1 5)+ 2)*)-)+
  10. \textbf{b)}
  11. Preorder und Postorder Darstellungen sind auch ohne Klammerung
  12. oder Operator-Rangfolgen eindeutig, da
  13. hier immer nur eine Möglichkeit existiert, den Operator anzuwenden,
  14. nämlich auf die zwei Ausdrücke, die vor, bzw. hinter dem Operator stehen.
  15. Bei Inorder Darstellung ist das nicht eindeutig.
  16. \textbf{c)}
  17. Die Reihenfolge \textit{Wurzel} - \textit{Rechts} - \textit{Links} ist
  18. die Postorder Darstellung gespiegelt, da Postorder: \textit{Links}
  19. \textit{Rechts} \textit{Wurzel}.
  20. \begin{aufgabe}[Lineare Gleichungssysteme in EBNF]
  21. \end{aufgabe}
  22. \begin{tabular}{lcl}
  23. <LGS> & ::= & <Gleichung> \{\te{\textbackslash n} <Gleichung>\}\\
  24. <Gleichung> & ::= & \{<Summand>\}$^{+}$ \te{=} <Zahl> \\
  25. <Summand> & ::= & $\left[+ \mid -\right]$ $[$<Zahl>$]$ \te{$x$} <Index>\\
  26. <Zahl> & ::= & \{<Ziffer>\}$^{+}$ \\
  27. <Index> & ::= & \{Indexziffer\}$^{+}$ \\
  28. <Ziffer> & ::= & \te{0} | \te{1} | \te{2} | \te{3} | \te{4} | \te{5}
  29. | \te{6} | \te{7} | \te{8} | \te{9} \\
  30. <Indexziffer> & ::= & \te{$_{0}$} | \te{$_{1}$} | \te{$_{2}$} | \te{$_{3}$} | \te{$_{4}$} | \te{$_{5}$}
  31. | \te{$_{6}$} | \te{$_{7}$} | \te{$_{8}$} | \te{$_{9}$} \\
  32. \end{tabular}
  33. Es ist nicht möglich, mir dieser EBNF-Grammatik sicherzustellen, dass die
  34. Anzahl der Variablen und die Anzahl der Gleichungen gleich sind, da
  35. keine gemeinsame Nummerierung verwendet wird.
  36. \begin{aufgabe}[Schnelle Potenzberechnung]
  37. \end{aufgabe}
  38. siehe \textit{uebung2.cpp}
  39. \begin{aufgabe}[Vollkommene Zahlen]
  40. \end{aufgabe}
  41. siehe \textit{uebung2.cpp}
  42. \end{document}