Initial Commit

This commit is contained in:
2022-10-07 00:44:12 -03:00
commit 8ff85da81c
308 changed files with 10106 additions and 0 deletions

View File

@ -0,0 +1,19 @@
/**
A utility class that provide methods to compute elements of the
recursive sequence.
@author Leah Bidlake
*/
public class Seq{
/**
Recursively computes seq(n).
@param n Non-negative integer.
@return int Element n in the recursive sequence.
*/
public static int seqR(int n){
//TODO: this should look very much like the
//mathematical specification
}
}

View File

@ -0,0 +1,23 @@
import java.util.Scanner;
/**
A simple driver that uses the Seq class to compute the
nth element of the sequence.
*/
public class TestSeq{
public static void main(String[] args){
int n, seqRec, seqMem, seqIter;
Scanner scan = new Scanner(System.in);
System.out.print("Enter a positive integer: ");
n = scan.nextInt();
seqRec = Seq.seqR(n);
System.out.println("seqR(" + n + ") is: " + seqRec);
}
}
}