This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: text . long int catalan(int number) // catalan number { // uses pascal's triange; assume 0 <= n <= 20 long int triangle[39][39] = {0}; // it never gets bigger than this int n, k; // see section 8.1.1 of the text for (n = 0; n < 39; n++) triangle[n][0] = 1; for (n = 1; n < 39; n++) // fill in pascal's triangle for (k = 1; k <= n; k++) triangle[n][k] = triangle[n1][k1] + triangle[n1] [k]; return triangle[2*number  2][number  1] / number; } // end catalan() The grading criteria are available. These are subject to interpretation by the grader. As we stated in class, our primary goal in the grading of these exams is consistency. If your intrepretation differs from the grader's and the grader has applied her/his criteria uniformly, then the grader's interpretation will prevail. [cs2223 text] [News] [Syllabus] [Exams] [Exam 3] Contents ©19941998, Norman Wittels Updated 17Apr98...
View
Full
Document
This note was uploaded on 11/10/2009 for the course CS 2223 taught by Professor Ruiz during the Fall '05 term at WPI.
 Fall '05
 RUIZ
 Algorithms

Click to edit the document details