Skip to content

Instantly share code, notes, and snippets.

@Wendly
Last active September 17, 2015 10:39
Show Gist options
  • Save Wendly/73d6552df00fdf7ac1e7 to your computer and use it in GitHub Desktop.
Save Wendly/73d6552df00fdf7ac1e7 to your computer and use it in GitHub Desktop.
差分方程式
x(i) = x(i - 1) + x(i - 2)
現況
private i = 2;
private int[] x = new int[i + 1];
void func() {
x[i] = x[i - 1] + x[i - 2];
//update buffer
x[i - 2] = x[i - 1]; //x[1] <= x(i - 2)
x[i - 1] = x[i]; //x[0] <= x(i - 1)
}
期望
private int x;
void func() {
x(i) = x(i - 1) + x(i - 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment