Lecture Notes, Sample Programs and Solutions
Topics Covered
- Week 1Topics Covered: Stored-Program Model; Algorithms - properties, preciseness, determinism, definite entry and exit, repeatability; Variables and constants (As programming model and not in Java). Notion of types; An algorithm description to add first 10 numbers.Week 2Expressions; Operators; Data types
Week 3Topics Covered: Variable declaration statements; If - then - else statements; Scoping of variables; Dangling Else (association of else with right if); Grouping of statements to make a single statement (i.e. putting curly braces around the statements); Introduction to the for loop; Boolean data types and boolena expressions. Relations Operators such as <, >, <=3D, >=3D, =3D=3D, !=3D Integer Operators such as % and /.Week 4Topics Covered: For loop; While loop; Loop building techniques; Operators post/pre increment and post/pre decrement.Week 5Topics Covered: Methods, Parameter passing for the methods, Recursion.Week 6Topics Covered: Introduction to class as user defiend data type.Week 7Topics Covered: Defined the class and objects
Constructors
Default constructor and clone constructor
char data type
String class
Methods of String class (charAt, length, compareTo, compareToIgnoreCase, indexOf, replace, substring, toLowerCase, toUpperCase)
Scanner class
Methods of Scanner class (next(), nextBoolean(), nextByte(), nextDouble(), nextFloat(), nextInt(), nextLine(), nextLong(), nextShort()).Week 8Topics Covered: Arrays (1-d)Week 9Topics Covered: Arrays (Multidimensional)
Program building (using multiple classes and objects)
Operators such as +=, -=, *=, /=, &, |, ^, &=, |=, ^=.Week 10Topics Covered: Break and Continue statements
Introduction to Exception, try and catch.Week 11Topics Covered: Selection Sort Algorithm
Big-oh notation of space and time complexity
Merge sort algorithmWeek 12Topics Covered:Search Algorithms (linear and binary)
Recursive Algorithms: TowerOfHanoi, Permutations of distinct integers
Command line arguments
System.exit method
Singly Linked list, insertion of elements in front and at end
Deletion of elements in the listWeek 13Topics Covered: Doubly Linked list, insertion of elements in front, at end, after and before a given element, deletion of elements in the list.
Class inheritance, type cast operators for the objects.
- Lecture Notes :
- Lecture 10Lecture 11Lecture 12Lecture 13Lecture 14Lecture 15Lecture 16Lecture 17Lecture 18Lecture 19Lecture 20Lecture 21Lecture 22Lecture 23Lecture 24Lecture 25Lecture 26Lecture 27Lecture 28Lecture 29No ClassLecture 30Lecture 31Lecture 32Lecture 33Lecture 34Lecture 35Lecture 36Lecture 37Lecture 38Lecture 39Lecture 40
- Sample Programs
Converts an integer to any base string Int2BaseString.java Find an integer square root of an integer IntSqRoot.java Average of upto 20 integers Average.java Average of any number of integers AnySizeAverage.java Program to print the day of a given date and calendar for that month Cal.java Sudoku Solver - In case you are not able to compile it in linux, the problem is most probably with the version of Java being used. Blackdown Java 1.4.2 does not provide Scanner class. The code will run perfectly on Sun Java 6. Sudoku.java Program to do selection and merge sort for random arrays and print the timings sort.java Program to print the permutations of distinct integers given on the command line permute.java
No comments:
Post a Comment