Search This Blog

Monday, February 24, 2014

UNIT 2 notes



Unit 2 notes updated in the below link:


https://sites.google.com/site/cs6202pds1/

Tuesday, February 18, 2014

Assignment I

 

Important question for Internal 1 

                                            Part A


  1.       What will be the output of the following program, when the value of i is 5 and 10
void main()
{
 int i;
scanf(“%d”,&i);
if(i==5)
 printf(“FIVE”);
}
  2.       Differentiate while and do while with simple example.
  3.       Write a code segment using while to print numbers from 10 down to 1.
  4.       How does the break statement provide a better control of loops.
  5.       Write the c program for the following expressions
i)                    A=5<=9 && 6!=5
ii)                   A=b++ + ++b where b=50
   6.       Write the following condition using “ ? : “ operators,
Salary = 4x+100                           If x<=40
Salary = 300                                 if x==40
Salary = 4.5x +150                      if x>40
  7.       What is the value of b[0] in the following program.
void main()
{
int a[5]={1,4,6,9,3}
int *b;
b=&a[2];
}
  8.       Differentiate between Library and User defined Functions.
  9.       What is the need for user defined functions?
  10.   Is main is a keyword in C language? Justify.
  11.   What is self referential structure?
  12.   struct
{
  char name[20];
  int num;
} student;
What is the size of the structure and union for the above program? Justify it.
  13.   What is the need for file?
  14.   List the formatted and unformatted file functions.  
  15.   Define getw() and putw() functions. 
  16 How will you find the End of a file? 
  17.What  is the use of ftell()? 

18. Can we place the file pointer in the required position? Justify your answer. 

19. What are the advantages of unions over structure? 

20.Which is required the header file for the file manipulation?

21.  What do you understand by strings? How do you declare a string?

 22. What is a Macro? Why do we use macros in C programs? 

                                        PART B


       1.    A) Write a C program to find Fibonacci series using Recursion. (8)

     B) What is 2 dimensional array how to declare and initialize an 2d array in C. illustrate with an   example

       2. A) What is mean by Preprocessor explain any 2 preprocessor directives with examples.

           B) Write a C program that read a character and display only the vowels using switch case.

       3. a) Discuss about pointers and its use in C. (8)

           b) Write a C program to reverse a given number. (8)

       4. a) Explain about structure declaration in C with suitable example.

           b) Maintain employee records for a company using array of structures.

       5. a) Describe various file handling functions with example.

           b) Write a program to copy the content of source file into destination.

       6. a) Explain the File operations in Binary Modes.(8)

            b) Manipulate the student details using Binary Files.(8).

      7. a)Explain all loop statements in C Language with example.(8)

         b) Explain in detail about Union with an example. (8)

    8. Write a C-program to exchange two given values using function      

         module  (a) call by value (8)  (b) call by reference.(8)
9.     Write A Program to input marks in 5 subjects, calculate the %age and display the division as per the following rules-                                                           
 a.  Percentage >=60  –  First                                                                         
 b.  %age >=50  –Second    
 c.  %age >=40  – Third   
 d.  %age <40    -- Fail.   (16)
10. Explain briefly about different types of Array.  (8)


        

Saturday, February 15, 2014

NOTES LINK



Click the below link for PDS I notes..


https://sites.google.com/site/cs6202pds1/




Syllabus CS6202 PROGRAMMING AND DATA STRUCTURES I






CS6202   PROGRAMMING AND DATA STRUCTURES I                                L T P C
3 0 0 3


UNIT I C PROGRAMMING FUNDAMENTALS  - A REVIEW                                     9
Conditional statements –Control statements –Functions – Arrays –Preprocessor-Pointers Variation in pointer declarations –Function Pointers –Function with Variable number of arguments

UNIT II CPROGRAMMING ADVANCED FEATURES                                                    9
Structures and Unions -File handling concepts – File read –write –binary and Stdio -File Manipulations

UNIT III LINEAR DATA STRUCTURES – LIST                                                                            9
Abstract Data Types (ADTs) – List ADT –array-based implementation –linked list implementation –– singly linked lists-circularly linked lists-doubly-linked lists –applications of lists –Polynomial Manipulation –All operation (Insertion, Deletion, Merge, Traversal)

UNIT IV LINEAR DATA STRUCTURES – STACKS, QUEUES                                                    9
Stack ADT –Evaluating arithmetic expressions -other applications-Queue ADT –circular queue implementation –Double ended Queues –applications of queues

UNIT V
SORTING, SEARCHING AND HASH TECHNIQUES                                                        9
Sorting  algorithms: Insertion sort -Selection sort -Shell sort -Bubble sort -Quick sort -
Merge sort -Radix sort –Searching: Linear search –Binary Search Hashing: Hash Functions –Separate Chaining –Open Addressing –Rehashing –Extendible Hashing

     TOTAL: 45 PERIODS
TEXT BOOKS:
1.Brian W. Kernighan and Dennis M. Ritchie, “The C Programming Language”, 2ndEdition, Pearson Education, 1988.
2.Mark Allen Weiss, “Data Structures and Algorithm Analysis in C”, 2ndEdition, Pearson Education, 1997.

REFERENCES:
1.Thomas H. Cormen, Charles E. Leiserson, Ronald L.Rivest, Clifford Stein, “Introduction to
Algorithms", Second Edition, Mcgraw Hill, 2002.
2.Reema Thareja, “Data Structures Using C”, Oxford University Press, 2011
3.Aho, Hopcroft and Ullman, “Data Structures and Algorithms”, Pearson Education,1983.
4.Stephen G. Kochan, “Programming in C”, 3rd edition, Pearson Ed.