| CCS 2100 | | Comp 310 | | CCS 1300 | | CCS 1200 | | CCS 1100 | | CCS 1000 | | CS 212 | | Email: cpuccs@yahoo.com

Wednesday, January 23, 2013

Quicksort atbp

Just wanted to share a very nice video on how Quicksort algorithm works.



The user also has more useful videos showing examples with other algorithm. Thanks Think Aloud Academy! Enjoy!

Wednesday, January 16, 2013

CCS 1200 Notes

Here is the link for the book that we are currently using in CCS 1200: Object-Oriented Programming Using C++.  (Note: click the smaller download link, not the big one in the ads):

Object-Oriented Programming Using C++ 4th Ed. by Joyce Farrell
URL: http://www.2shared.com/document/s267veZe/Object-Oriented_Programming_Us.html

Remember that this is just a reference and this is not the official textbook for the course.


Monday, January 14, 2013

Linked Lists Example

The following is the link for the complete sample program of an integer list that use Link lists data structure. (Note: click the smaller download link, not the big one in the ads):

Linked Lists
http://www.2shared.com/file/wXvYA1aw/Linked.html

The file is in ZIP format. Simply extract it to access the codes.

Or you may encode the following 5 java classes:

---------------------------------TestProg_Linked.java-----------------------

import java.io.*;
import java.util.*;

public class TestProg_Linked
{
    static BufferedReader keyboard = new
           BufferedReader(new InputStreamReader(System.in));

Wednesday, January 9, 2013

Array-Based Lists Example

The following is the link for the complete sample program of an integer list that use array-based data structure. (Note: click the smaller download link, not the big one in the ads):

Array-Based List
URL: http://www.2shared.com/file/pA8UVyql/1_-_Array_Based.html

The file is in ZIP format. Simply extract it to access the codes.

Or you may encode the following 5 java classes:

------------------------TestProg_Array.java------------------------

//Test Program Integer Array List
import java.io.*;
import java.util.*;

public class TestProg_Array
{
    static BufferedReader keyboard = new
           BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) throws IOException
    {
        UnorderedArrayList intList = new UnorderedArrayList(50);
        IntElement num = new IntElement();

Wednesday, December 19, 2012

Review: Switch Case Java Samples


This is a simple example of how Switch Case statements in Java work:

-----------------------------SwitchCase.java-----------------------------

import java.io.*;
import java.util.*;

public class SwitchCase {
public static void main(String [] args) throws IOException{
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
int x = 2;
switch(x){
case 1:
System.out.println("x is 1!");
break;
case 2:
System.out.println("x is 2!");
                  System.out.println("Hello!");
                  break;
case 3:
System.out.println("x is 3!");
break;
default:
          System.out.println("x is invalid!");
break;
} // switch closes
}
}


-----------------------------end of SwitchCase.java-----------------------------

Problem: Create a program that would ask the user for the following options:
1: to add
2: to multiply
3: to deduct
Then ask the user for two numbers and display the answer based on the operation chosen.

----------------------Calc.java----------------------------

import java.io.*;
import java.util.*;

public class Calc {
public static void main(String [] args) throws IOException{
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
int option, first, second, answer;

System.out.print("1: to add \n2: to multiply \n3: to deduct \nEnter option: ");
option = Integer.parseInt(keyboard.readLine());
System.out.print("Enter first number: ");
first = Integer.parseInt(keyboard.readLine());
System.out.print("Enter second number: ");
second = Integer.parseInt(keyboard.readLine());

switch(option){
case 1: answer = first + second; break;
case 2: answer = first * second; break;
case 3: answer = first - second; break;
default: System.out.print("Invalid"); answer = 0; break;
}

System.out.println("Answer: " + answer);
}
}


----------------------end of Calc.java----------------------------


------------------------Options.java ----------------------------------



import java.io.*; import java.util.*;
public class Options {
public static void main(String [] args) throws IOException{
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
int option;
System.out.print("Enter option: ");
option = Integer.parseInt(keyboard.readLine());

switch(option){
case 1:
for(int i = 1; i <= 10; i++) { System.out.print(i + " ");}
break;
case 2:
int sum, no1, no2;
System.out.print("Enter first number: ");
no1 = Integer.parseInt(keyboard.readLine());
System.out.print("Enter second number: ");
no2 = Integer.parseInt(keyboard.readLine());
sum = no1 + no2;
System.out.print("The sum is " + sum);
break;
case 3:
int no, rem;
System.out.print("Enter number: ");
no = Integer.parseInt(keyboard.readLine());
rem = no % 2;
if(rem == 1) System.out.print("Odd.");
else System.out.print("Even");
break;
default:
System.out.print("Invalid option");
break;
}

}

}


------------------------end of Options.java ----------------------------------

Monday, December 10, 2012

Research Assignment for CCS 1300

Research Assignment for CCS 1300

Define, identify the functions and methods(and their purpose), and give concrete examples (both in real life and in programming) of the basic types of data structures:

1.     Array – Based Lists
2.     Linked – Lists
3.     Recursion
4.     Stacks
5.     Queues

Pass with your full name, subject description, stub code and lecture schedule at the top of the document.

Format: Short Bond Paper
            Margins: 1” in 4 corners
            Font: Arial
            Size: 11

Deadline: for soft copies, email to cpuccs@yahoo.com with the subject “1300 Research” until January 3, 2013. If the subject is incorrect, your email will be ignored.

For hard copies, pass your work on or before January 8, 2013. Late papers will not be accepted and would automatically merit a score of ZERO. No need to place in a folder but keep the papers neat and stapled properly.

Note: Plagiarism would not merit any score. Although noting references is allowed, copy/paste method is NOT.

- Sir Rod.


Monday, December 3, 2012

Presentations for Chapter 1 and 2

The following are the download links for Chapter 1 and 2 of out CCS 1300 Data Structures and Algorithm classes.

Chapter 1:
http://www.2shared.com/document/wFrd5n4D/chap01.html

Chapter 2:
http://www.2shared.com/document/lihquBR0/chap02.html

P.S. Note that the download button would be the smaller one at the bottom, not the one in the ads.