Académique Documents
Professionnel Documents
Culture Documents
The Course spans about 4-5 working weeks and rapidly builds from a state of no
t much acquaintance with C to a state of advanced programming .The course also
covers a large set of sorting and searching algorithms.
1.Presentation focuses on ANSI C and latest ISO c99 standards
2.Implementation dependencies for a given compiler will be studied
3.Guidelines to avoid implementation dependent results are provided
Hands on Lab work for the participants is categorized into the following four it
ems:
1.Working on the lab assignments on a daily basis.
2.Working on the implementations as documented in the detailed course coverage
below. These implementation might require assistance from the instructor
3.Implementing the behavior of some UNIX commands like:
cat, cp, mv, head,tail,cut,paste and some of the features of gre
p
4.Schedule towards the end of the training program consists of working on all th
e
1) exercises/problems from the relevant topics of the book:
The C programming Language by K&R
2) Variety of exercises involving text editor, spread sheet editors, num
eric and text processing.
Day11:
Preprocessing
Concatenation of adjacent constant strings
Preprocessing directives
File inclusion
System header files
User defined header files
Macros
Object-like macros
Definitions and usage
Text replacement without any evaluation
Emphasis on the time of text replacement.
Macros with various values resulting in differing types
Predefined macros: date, time, file and line number macros
Standard C and C version macros.
Function-like macros
Definitions and usage
Working with spaces in macros definitions
Multi-line function-like macros
Differences between functions and function-like macros
Side effects with operators like ++ in argument list to macros
Guidelines to reduce the invisible side effects
# and ## operators with function-like macros
Scope of macros and undefining macros
Rescanning and further replacement of macros
Assert predefined macro
Conditional compilations
#if, #ifdef, #ifndef, #else, #elif and #endif
Debug versions of programs
Compiling for a specific OS or platform
Handling multiple inclusions of a file with conditional compilations
Line and file name control with #line directive
Compilation error messages with #error directive
Guidelines for developing user defined header files
Structure/Union tag defiitions
Functions and variable declarations
Assigments:
Involving include files, studying their location
Difference between function call and macros
Conditional compilation : generating debug and non-debug versions of exe
cutable files
Day12:
Algorithms & Abstract data structures
Algorithms definitions
Performance of algorithms
Experimental studies Vs complexity analysis
Time complexity
Space complexity
Big O, Omega and Theta notation for analysis of algorithms
Asymptotic behavior of algorithms
N square Vs N log N functions
Abstract Data Structures
Definition
Example with a linked list
Lists
Stacks and Queues
Array implementations
Linked list implementations
Complexity study
Circular queues
Linked lists
Insertion, deletion, modification and traversal
Complexity study
Circular linked lists
Doubly linked lists
Doubly linked Circular lists
Assigments:
Expression evaluations
Postfix expressions
Conversion from infix notation to post fix notation
Polynomial operations with linked lists
Sparse matrix operations with linked lists
Mathematical sets
List of linked lists for Union & intersection
Day13:
Sorting algorithms
Bubble sort
Insertion sort
Selection sort
Implement one of the above
Merge sort
Quick sort
Implement one of the above
Heap sort, building and destroying a heap
Implement heap sort
Complexity analysis of the above sorts
Assignments:
Implement 3-4 sorting algorithms from the above listed
Implementations involve sorting a set of numbers followed by sorting a s
et of strings
Day14
Searching Algorithms
Linear Search
Complexity analysis
Improvising the efficiency of linear search
Move to the Front method
Transposition method
Hashing
Hash functions
Collisions and avoidance
Splitting a list to sub-lists for hashing
Binary search
Complexity Analysis
Study the phases of compilation using the respective options from gcc
Preprocessing
compilation
linking
Wide characters& Multi-byte characters
The universal character set UCS
The Unicode standard
Introduction to Unicode characters of an Indian language
Introduction to UTF storage mechanism of the given language(U T F 16)
Definitions of wide and multi-byte characters and their differences
Wide character, wchar_t, definition
Wide character strings
Conversion from wide to multi-byte & multi-byte to wide characters
Library functions for wide character & string I/O
Char functions: getcw(), putwc() and ungetwc()
String I/O functions: fgetws() and fputws()
Formatted I/O functions: wprintf() and wscanf()
fwprintf() and fwscanf()
Library functions for wide character processing
iswalpha(), iswalnum(), iswdigit(),.....
towupper() and towlower()
Library functions for wide character string processing
wcslen(), wcscpy(), wcsncpy(), wcscmp ()and wcsncmp()
wcschr(),wcsrchr(),wcsstr(), wcstok(),
wcstol() and wcstod()
Library functions for I/O with wide character string target
Input from string with swscanf()
Output to string with swprintf()
Assignments:
Implement linear & binary searchs and hasing
Problems involving Wide char I/O and processing.(possibly on Linux with
an Indian language)
Day15 - 18:
Completion of any pending assignments, implementations & UNIX commands
Working on the all exercises/problems from the relevant topics of the bo
ok:
The C programming language by Kernighan & Ritchie
Day 19: Implement a text file editor.
Should support up to 20 lines of text each with maximum length of 80 ch
ars
Four Arrow keys support for cursor movement
Save, save as, overwrite&replace modes, search & replace ,
inserting empty lines, deleting a char, word and line ,
copy&paste operations to be supported.
Study & implement any features you like from the vi editor
Day20: Implement mathematical and numeric processing programs
Study the precession loss with storage and calculations with floating ty
pes.
Study the Maximum& minimum values of float, double and long double.
Study what data structures are best suited for the mathematical sets ope
rations:
Implement Union, Intersection, Complement, Cartesian product
Implement partitioning a set into disjoint sub sets
Implement numerical integration of simple mathematical functions using
various methods.
Implement solution of simultaneous linear equations with six variables
Day21: Implement the character and string processing functions as they are
supported in the C-library:
isalpha(), sialnum(), isdigit(),.....
toupper() and tolower()
strlen(), strcpy(), strncpy(), strcmp ()and strncmp()
strchr(),strrchr(),strstr(), strtok(),
atoi() and atof()
sprintf() for converting numeric types to strings.
memset(), memcpy() memmove(), memcmp()
Using read() & write() system calls implement the I/O functions as they
are
supported in the C-library:
putchar(), getchar(),
puts(), gets()
printf() and scanf()
Implement the variable arguments list functions support
Use pointers in to the function call stack to support the following:
Define the type va_list
Implement the macros va_start(), va_arg() and va_end() macros.
Implement a spell check program on a text file.
Allow corrections for each spelling mistake
Display the closest corrections from the system dictionary given in /usr
/share/dict/words file.
Day22:
Implement a spread sheet editor package
Should support up to 10 X 10 cells.
Strings,integers and floats to be supported for data in cells
Four arrow keys for cursor movement
Spread sheet to be stored in text format in files.
Sorting a range of cells based on primary and secondary key fields
Entire row/column deletion and insertion.
Row/column copy&paste operation
Sum of entire row/colum for numeric data fields.
Day23: Implement the solitaire game using playing cards simulation
Should support all the operations as supported by MS windows solitaire g
ame.