栈
0.1
数据结构_第3章
|
实现AckerMann函数。 More...
#include <Ackermann.hh>
Public Member Functions | |
Akm_t (std::string name="name") | |
Construct a new Akm_t object. More... | |
~Akm_t ()=default | |
Destroy the Akm_t object. More... | |
Static Public Member Functions | |
static void | Akm_loop (int x, int y) |
堆栈版本的Ackermann函数 More... | |
static void | Akm_rec (int x, int y) |
递归版本的Ackermann函数 More... | |
Static Private Member Functions | |
static int | Ackermann (int m, int n) |
Ackermann函数递归版本 More... | |
static int | AckermannLoop (int m, int n) |
Ackermann函数堆栈模拟递归版本 More... | |
static void | AkmInit () |
初始化类内部的静态计数器 More... | |
Private Attributes | |
std::string | _name |
对象标识 More... | |
Static Private Attributes | |
static int | Akm_deep = 0 |
记录当前递归深度 More... | |
static int | deep_max = 0 |
记录最大递归深度 More... | |
|
inline |
Construct a new Akm_t object.
name | 对象标识符. |
传入的参数不会被使用
Definition at line 82 of file Ackermann.hh.
|
default |
Destroy the Akm_t object.
|
staticprivate |
Ackermann函数递归版本
是工具函数
m | 第一个参数, 建议取1 ~ 4 |
n | 第二个参数, 建议取1 ~ 13 |
Definition at line 150 of file Ackermann.hh.
References Akm_deep, and deep_max.
Referenced by Akm_rec().
|
staticprivate |
Ackermann函数堆栈模拟递归版本
是工具函数
m | 第一个参数, 建议取1 ~ 4 |
n | 第二个参数, 建议取1 ~ 13 |
Definition at line 179 of file Ackermann.hh.
References Akm_deep, deep_max, Stack::seqStack< T >::elemMem(), Stack::seqStack< T >::isEmpty(), Stack::seqStack< T >::pop(), Stack::seqStack< T >::push(), Stack::seqStack< T >::size(), and Stack::seqStack< T >::top().
Referenced by Akm_loop().
|
static |
堆栈版本的Ackermann函数
x | 参数1, 建议取1 ~ 4 |
y | 参数2, 建议取1 ~ 13 |
将会半实时刷新当前堆栈深度。当最大深度增加时, 刷新显示内容
Definition at line 117 of file Ackermann.hh.
References AckermannLoop(), and AkmInit().
Referenced by main().
|
static |
递归版本的Ackermann函数
x | 参数1, 建议取1 ~ 4 |
y | 参数2, 建议取1 ~ 13 |
将会半实时刷新当前递归深度。当最大深度增加时, 刷新显示内容
Definition at line 132 of file Ackermann.hh.
References Ackermann(), Akm_deep, AkmInit(), and deep_max.
Referenced by main().
|
inlinestaticprivate |
初始化类内部的静态计数器
Definition at line 68 of file Ackermann.hh.
References Akm_deep, and deep_max.
Referenced by Akm_loop(), and Akm_rec().
|
private |
|
staticprivate |
记录当前递归深度
Definition at line 70 of file Ackermann.hh.
Referenced by Ackermann(), AckermannLoop(), Akm_rec(), and AkmInit().
|
staticprivate |
记录最大递归深度
Definition at line 71 of file Ackermann.hh.
Referenced by Ackermann(), AckermannLoop(), Akm_rec(), and AkmInit().