Search This Blog

Lecture Notes, Sample Programs and Solutions





Lecture Notes, Sample Programs and Solutions

Topics Covered

Week 1
Topics 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 2
Expressions; Operators; Data types

Week 3
Topics 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 4
Topics Covered: For loop; While loop; Loop building techniques; Operators post/pre increment and post/pre decrement.
Week 5
Topics Covered: Methods, Parameter passing for the methods, Recursion.
Week 6
Topics Covered: Introduction to class as user defiend data type.
Week 7
Topics 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 8
Topics Covered: Arrays (1-d)
Week 9
Topics Covered: Arrays (Multidimensional)
Program building (using multiple classes and objects)
Operators such as +=, -=, *=, /=, &, |, ^, &=, |=, ^=.
Week 10
Topics Covered: Break and Continue statements
Introduction to Exception, try and catch.
Week 11
Topics Covered: Selection Sort Algorithm
Big-oh notation of space and time complexity
Merge sort algorithm
Week 12
Topics 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 list
Week 13
Topics 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 10
Lecture 11
Lecture 12
Lecture 13
Lecture 14
Lecture 15
Lecture 16
Lecture 17
Lecture 18
Lecture 19
Lecture 20
Lecture 21
Lecture 22
Lecture 23
Lecture 24
Lecture 25
Lecture 26
Lecture 27
Lecture 28
Lecture 29
No Class
Lecture 30
Lecture 31
Lecture 32
Lecture 33
Lecture 34
Lecture 35
Lecture 36
Lecture 37
Lecture 38
Lecture 39
Lecture 40
Sample Programs
Converts an integer to any base stringInt2BaseString.java
Find an integer square root of an integerIntSqRoot.java
Average of upto 20 integersAverage.java
Average of any number of integersAnySizeAverage.java
Program to print the day of a given date and calendar for that monthCal.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 timingssort.java
Program to print the permutations of distinct integers given on the command linepermute.java


No comments:

Post a Comment