Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 1351 Semester Summary. CSC 1351 Summary A study aid Not an exclusive set of study materials Please check:

Similar presentations


Presentation on theme: "CSC 1351 Semester Summary. CSC 1351 Summary A study aid Not an exclusive set of study materials Please check:"— Presentation transcript:

1 CSC 1351 Semester Summary

2 CSC 1351 Summary A study aid Not an exclusive set of study materials Please check: http://www.cct.lsu.edu/~sbrandt/csc1351/ http://www.cct.lsu.edu/~sbrandt/csc1351/ Please look at quizzes, exams, homework

3 CSC 1351 Summary Know the definitions for: interface class abstract class constructor polymorphism (override + dynamic lookup) callback primitive types Objects

4 CSC 1351 Summary Code: The "Hello, World" program The Applet version of "Hello, World" How to write a sorter Array manipulation Examples for definitions

5 CSC 1351 Summary String vs. String Buffer know basic methods and what they do class Object String toString() int hashCode() boolean equals(Object)

6 CSC 1351 Summary Recursion Understand how to write recursive programs fibonacci factorial double factorial how to convert a loop to a recursive call expect a never-before-seen recursive call

7 Recursion Example: Greatest Common Denominator public class GCD { public static int gcd(int x,int y) { if(y == 0) return x; System.out.println("x="+x+",y="+y); return gcd(y,x%y); } public static void main(String[] args) { int a0 = Integer.parseInt(args[0]); int a1 = Integer.parseInt(args[1]); System.out.println("gcd("+args[0]+","+args[1]+")="+gcd(a0,a1)); }

8 CSC 1351 Summary Input/Output Streams vs. Writers Know what's there  InputStreamReader  Sockets  BufferedWriter  etc. Know how to make your own Writer, Reader, InputStream, OutputStream

9 Example: BufferStream import java.io.PrintStream; public class BufferStream extends java.io.OutputStream { StringBuffer sb = new StringBuffer(); @Override public void write(int n) throws java.io.IOException { sb.append((char)n); } @Override public String toString() { return sb.toString(); } public static void main(String[] args) { BufferStream bs = new BufferStream(); PrintStream ps = new PrintStream(bs); ps.println("Hello,"); ps.println("World"); ps.close(); System.out.println("All done"); System.out.println("buffer="+bs); }

10 CSC 1351 Summary Regular Expressions Literal Character Class Group Non-Capturing Group Quantifier Reluctant Quantifier Expect questions of the form "what pattern matches this"

11 Regex Example import java.util.regex.Pattern; import java.util.regex.Matcher; public class Eqn { public static void main(String[] args) { Pattern p = Pattern.compile( "\\d+([+\\-]\\d+)*=\\d+"); Matcher m = p.matcher( "3+4=7 100-9+11=102 3+8 9-4+ 1=1"); while(m.find()) System.out.println(m.group()); }

12 CSC 1351 Summary Know the basic sorters we've discussed (relevant speeds, concept of how they work) MergeSort QuickSort BubbleSort SelectionSort Know the basic search strategies – Binary – Linear

13 Object Oriented Design Know what a CRC is Know how to diagram objects Know how to map diagrams to code Know what assert() does and how to use it Know what javadoc comments are

14 UML Basics Inherits, is a... Implements, is a... Aggregation, has a... Dependency

15 Big O Notation Understand what Big O notation means The fastest growing term, ignore the coefficients O(N 2 ) can apply to T(N) = 3*N 2 +100*N+10 4 O(N 2 ) can apply to T(N) = 5*N 2 Understand basic calculation  T(2*N) = T(N)+1 means O(log(N))  T(2*N) = 2*(N+T(N)) means O(N*log(N))  T(2*N) = 4*T(N) means O(N 2 )

16 CSC 1351 Summary Data structures Know the List interface Know ArrayList Know LinkedList Know the Map interface Know HashMap  Know how to implement a hash code Know TreeMap

17 CSC 1351 Summary Know how to implement an ArrayList Know how to implement a Hashtable Know what an AVL Tree is Know how to do right and left rotations


Download ppt "CSC 1351 Semester Summary. CSC 1351 Summary A study aid Not an exclusive set of study materials Please check:"

Similar presentations


Ads by Google