![]()
![]()
18th Dec:
Here's the
SOLUTION to the final exam.
16th Dec: Final grades have been posted to ISIS. Some stats on the final and the course are HERE
7th Dec: Homework 12 and 13 grades are available through courseworx and the solution has been posted on the homework page.
5th Dec: For Homework 13 you have to submit temp.c also in the tar file.
1st Dec: CGS3460 final exam will be conducted (as
scheduled by the registrar) on 10th Dec at 10 am. More information will be
released shortly.
29th Nov: Homework 13 has been assigned. Check the
homework page.
29th Nov: Homework 11 grades are available through courseworx and the solution has been posted on the homework page.
21st Nov: By (lack of) popular demand, there'll be no class Wednesday, November 21. Happy Thanksgiving.
19th Nov: Homework 12 has been assigned. Check the
homework page.
19th Nov: Solution for Midterm 1 is
here.
18th Nov: From now onwards TA Ritwik Kumar will be
holding his office hours in Room E331.
16th Nov: Homework 10 grades are available through courseworx and the solution has been posted on the homework page.
16th Nov: The deadline for Homework 11 has been extended to 11/19(Monday).
13th Nov: Homework 11 has been assigned. Check the
homework page.
9th Nov: Homework 9 grades are available through courseworx and the solution has been posted on the homework page.
9th Nov: The deadline for homework 10 has been extended by 3 days to 11/12(Monday) midnight. Also, you can get 25% extra credit if you can make your computer player unbeatable. We would evaluate this by playing 4-5 times against the computer and if we cannot beat the computer, you will get the extra credit.
3rd Nov: Homework 10 has been assigned. Check the
homework page.
2nd Nov: The deadline for homework 9 has been
extended by one day to 11/3(Saturday) midnight.
26th Oct: Homework 8 grades are available through courseworx and the solution has been posted on the homework page.
26th Oct: HERE is the Powerpoint
presentation regarding the midterm.
23rd Oct: The deadline for homework 9 has been
extended by one week to 11/2.
23rd Oct: Hints for Homework 9:
1. If you are using scanf() along with gets() in your program, you
might want to use the function getchar() after you use scanf() as the scanf
leaves outs a '\n' from the user input which might lead to unexpected results
if you use gets() after scanf().
Example:
#include<stdio.h>
int main()
{
int ch;
char str[256];
printf("Enter a number: ");
scanf("%d",&ch);
getchar(); // This would remove the newline from the input.
printf("Enter a string: ");
gets(str);
printf("%d %s\n",ch,str);
}
2.
For palindrome, following might give you some idea regarding how to go
about recursion here
palindrome: The function which we call recursively
str: The character array
n: The current character
The function palindrome may have something along the following lines:
if(some condition on n) // till we don't
exceed the string length
if(str[n] == str[strlen(str)-n-1]) // checking if nth
character matches its corresponding character
return palindrome(str,n+1); // check
the same for the next character
else
return 0; // Obviously the string is
not a palindrome
For x^a, use the fact that x^a = x*x^(a-1) and x^0 = 1.
For x!, use the fact that x! = x * (x-1)! and 1! = 1.
For No. of occurrences, one possible way to implement is to have a
function which returns 1 if a match (match between the character you are
searching and the character at the current location) is found at the current
location and 0 if no match is found. In either case, call this function
recursive with the current location incremented. The recursion should
terminate when the current character exceeds the length of the string.
arr: The character array
search: The function which we call recursively
The function search may have something along the following lines:
if(n == arr[i])
return 1 + search(arr,n,i+1);
else
return 0 + search(arr,n,i+1);
For Binary search, the link provided has details on recursion. You
would have to sort the list before binary search can be used and for this you
can use any of the sorting methods, including the one discussed at length in
class. Though, the sorting need not be recursively implemented.
20th Oct: Homework 9 has been assigned. Check the
homework page.
18th Oct: Homework 7 grades are available through courseworx and the solution has been posted on the homework page.
17th Oct: The MIDTERM EXAM will be MONDAY, October 29, in class.
13th Oct: The program to be used in
Homework 8 has been posted on the homework page.
12th Oct: Homework 8 has been assigned. Check the
homework page.
10th Oct: Homework 6 grades are available through courseworx and the solution has been posted on the homework page.
5th Oct: Dr. Bermudez's office hours are cancelled for October 8, 10, and 12, as he'll be out of town. Please attend the TAs' office hours.
5th Oct: Homework 7 has been assigned. Check the
homework page.
4th Oct: Homework 5 grades are available through courseworx and the solution has been posted on the homework page.
1st Oct: Example 3 of Problem 2 of Homework 6 has
been changed.
28th Sep: Homework 6 has been assigned. Check the
homework page.
27th Sep: Homework 4 grades are available through courseworx and the solution has been posted on the homework page.
21nd Sep: Homework 5 has been assigned. Check the
homework page.
19th Sep: Homework 3 grades are available through
courseworx and the solution has been posted on the homework page.
16th Sep: Solutions for HW1 and HW2 have been posted
on the homework page.
15th Sep: Homework 4 has been assigned. Check the
homework page.
13th Sep: An explicit late homework policy has been added to the course syllabus
HERE. Late homework are NOT accepted.
12th Sep: Please direct your questions regarding homework 1 and homework 2 grades to either TA Do Park or TA Chunchun Zhao.
11th Sep: Homework 2 grades are available through courseworx.
10th Sep: Homework 1 grades are available through courseworx.
8th Sep: Homework 3 has been assigned. Check the homework page.
6th Sep: How to verify whether your
submission was correctly uploaded or not?
1. Use CourseWorX to download the uploaded assignment as outlined
here.
2. The file that you download will have a different name than whatever
you used while uploading it, but it is still the same file.
3. If you submitted your homework as a .tar file, the downloaded file
is still a .tar file though .tar is missing from the name. If you are working
from Windows, you can choose to do one of the following:
4a. Rename the downloaded file to
xx.tar and open it using some program like WINZIP to extract and verify the .c
files you submitted.
If you created the .c files on some non-Windows platform
using programs like vi, pico, emacs etc., it is possible that Notepad might
not
display the files properly but Wordpad will do in most cases.
OR
4b. Transfer the file you downloaded to rain using
sftp (use the same method you use to transfer .c files). Lets say the file's
name is
XX. After the transfer log in to rain (using putty if
working from Windows) and run 'tar -xvf XX' at the command prompt.
This will
extract the .c files. Its probably a good idea to do
this in a different directory than where you placed your original programs:
the
extracted files will overwrite existing ones with the same
name. You can use 'mkdir <directory name>' to create a directory and
'mv <old file location/filename> <new file location>'
to move a file from one directory to another. These commands must be typed at
the command prompt (through putty).
5. In either case if you find that either the files are missing or are
incorrect, resubmit the homework and try again.
6. If you are working on a LINUX, UNIX or SOLARIS machine, follow the
steps in 4b: you don't have to transfer the downloaded file.
6th Sep: In question 1 of homework 2, the specification incorrectly
states that "... value computed for the expression is 2.5467, only 2.54 is
displayed ..". The displayed value should be 2.55 and not 2.54 because "%f"
does rounding and not truncating.
3rd Sep: Deadline for Homework 2 has been changed to Sep 07.
2nd Sep: Homework 2 has been assigned. Check the homework page.
31st Aug: Instructions on how to submit an assignment have been added to
Tools for working from windows page.
28th Aug: Homework 1 has been assigned. Check the homework page.
28th Aug: All homework will be tested on CISE machine rain.cise.ufl.edu using GCC 3.4.2 compiler. It is your responsibility to make sure your program works on this machine and compiler. Check Tools for working from windows page for more details.