8
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II Section : CSE - 1 & 2 Subject Code : CS6202 Subject Name : Programming and Data Structures-I Degree & Branch : B.E – C.S.E. UNIT-1 2 MARK QUESTIONS: 1. List out the Conditional and Control statements in C. 2. Differentiate Break and Continue statement. 3. Differentiate function declaration and function definition. 4. What is Recursion? List out merits and demerits. 5. How multi-dimensional arrays are stored in C? 6. How arrays are passed to function? 7. What is a preprocessor? Give any two examples. 8. What is a String? How strings are printed in C? 9. Differentiate strchr() and strrchr() & sizeof() and strlen(). 10. What is a pointer? List out the benefits of pointers. 11. What is a pointer to pointer? 12. What is an array of pointers? 13. Distinguish (*p)[5] and *p[5]. 14. What is a pointer to function? 15. What is the use of stdarg.h? Give an example. 16. Give example for Pointer Arithmetic. 17. Write the features of Pointers.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

  • Upload
    dinhbao

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Year & Semester : I / II

Section : CSE - 1 & 2

Subject Code : CS6202

Subject Name : Programming and Data Structures-I

Degree & Branch : B.E – C.S.E.

UNIT-1

2 MARK QUESTIONS:

1. List out the Conditional and Control statements in C.

2. Differentiate Break and Continue statement.

3. Differentiate function declaration and function definition.

4. What is Recursion? List out merits and demerits.

5. How multi-dimensional arrays are stored in C?

6. How arrays are passed to function?

7. What is a preprocessor? Give any two examples.

8. What is a String? How strings are printed in C?

9. Differentiate strchr() and strrchr() & sizeof() and strlen().

10. What is a pointer? List out the benefits of pointers.

11. What is a pointer to pointer?

12. What is an array of pointers?

13. Distinguish (*p)[5] and *p[5].

14. What is a pointer to function?

15. What is the use of stdarg.h? Give an example.

16. Give example for Pointer Arithmetic.

17. Write the features of Pointers.

       

Page 2: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

18. Give differences between union and structure.

19. Define self referential structure with example.

20. What values does the following code print?

int k; int num = 30;

k = num > 5 ? (num <= 10 ? 100:200):500;

printf ( "k = %d\n", k );

16 MARK QUESTIONS:

1. What are the different primary and derived and void data types used in C? Give

examples.

2. Explain the conditional and loop statements available in C with a example program.

3. Distinguish between the following:

i. Actual and formal arguments

ii. Global and local variables

iii. Automatic and static variables

iv. Scope and visibility of variables

v. & operator and * operator

4. How 2D arrays are declared in C? Explain with an example.

5. Explain about pointers, and how the pointer variables are declared?

6. Describe the ways of passing parameters to functions with example.

7. Explain about pointer to function and how to pass the pointers to function?

8. What is a string? Also explain different string functions with example.

9. Explain how function with variable number of arguments is used in C program with an

example.

10. Explain the structure of C program.

Page 3: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

UNIT-2

2 Marks Questions

1. Differentiate Structure and Union.

2. How structure is declared and structure variable are accessed?

3. How does a structure differ from an array?

4. What is an array of structure and give example

5. What is slack byte?

6. What is meant by the following terms?

a) Nested structures

b) Array of structures

7. What is a pointer to structure? Give example

8. When do we use the following?

a) Unions

b) The Bitwise and sizeof() operator

9. What is a file? List out the file handling functions.

10. Explain the modes operation used in file.

11. Describe the use and limitations getc() and putc()

12. What is the Significance of EOF?

13. How does an append mode differ from a write mode?

14. Explain the general format of fseek() function?

15. What are the common uses of rewind() and ftell() functions?

16. What is the difference between rewind(fp); and fseek(fp,0L,2);?

17. Distinguish between getc() and getw().

18. Distinguish getc() and getchar().

19. When a program is terminated, all the files used by it are automatically closed. Whys

is it then necessary to close a file during execution of the program?

20. Explain fread() and fwrite()

Page 4: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

16/10/8 Marks Questions

1. Explain in details about Structures and Unions?

2. Explain about copying and comparing structure variables with example.

3. Explain the following in detail with examples.

a) Array of Structures

b) Arrays within the structures

c) Structures within the structures

d) Structure Pointer

4. How structure values are passed to function? Explain the methods.

5. Design a structure student_record to contain name, DOB, total marks obtained.

Develop a program to read data for 10 students in a class and list them rank-wise.

6. Explain the string handling function with examples.

7. Distinguish between the following functions.

a) getc() and getchar()

b) scanf() and fscanf()

c) printf() and fprintf()

d) feof() and ferror()

8. Write a program to copy the contents of one file into another.

9. Explain fread() and fwrite() with example program.

10. Explain the following file manipulation functions with examples.

a) rename()

b) freopen()

c) remove()

d) tmpfile(void), and

e) fflush()

Page 5: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

UNIT III

2 Marks Questions

1. Define Abstract Data Type.

2. What are the operations of ADT?

3. List out the areas in which Data Structures are applied extensively.

4. Define Non-linear Data Structure.

5. Distinguish between Linear and Non-Linear Data Structures.

6. What are the various operations done under the List ADT?

7. Mention the applications of List.

8. What is a Linked List?

9. What are the types of Linked List?

10. What is the need for the header?

11. Define Single Linked list.

12. Define Doubly Linked list.

13. Define Circular doubly Linked List?

14. Write down the steps to modify a Node in a Linked List.

15. Write the ways in which List ADT can be implemented.

16. List out the disadvantages of using a Linked List.

17. 17. State the difference between Arrays and Linked Lists.

18. 18. What is the advantage of Double Linked list over Single Linked list

implementation?

19. 19. List out the advantage of Circular linked list.

20. 20. Write the find routine in array implementation of list.

Page 6: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

16/10/8 Marks Questions

1. Explain the array implementation of list ADT with routine and example. (16)

2. What is a Linked List? Explain with suitable routine segments for any four

Operations (16)

3. Explain the application of Linked list in detail. (16)

4. Explain Polynomial manipulation using Linked Lists with an example.(16)

5. Explain the different types of Linked Lists and its Implementation.(16)

6. Explain Doubly Linked List with an example.(16)

7. a. With a pseudo code explain how a node can be inserted at a user specified

position in a Doubly Linked List (8)

b. Sort the Following Elements Using Radix Sort. (8)

10, 8, 21, 125, 54,174,187,250,1,65

8. Write a routine to merge two arrays and traverse the array (16)

9. Explain the insertion and deletion operations in a circular single linked list with a

routine and an example. (16)

10. Explain the insertion and deletion operations in a circular double linked list with

routine and an example. (16)

Page 7: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

UNIT IV

2 Marks Questions

1. Define a stack

2. List out the basic operations that can be performed on a stack

3. State the different ways of representing expressions

4. State the advantages of using infix notations.

5. State the advantages of using postfix notations.

6. State the rules to be followed during infix to postfix conversions

7. State the rules to be followed during infix to prefix conversions.

8. State the difference between stacks and linked lists

9. List the applications of stack

10. Write a routine to check whether the stack is full or empty.

11. Mention the advantages of representing stacks using linked lists than arrays

12. Write the equivalent prefix notation for infix expression p/q*r+s.

13. Define a queue

14. What are the types of queues?

15. Define circular queue

16. Define a priority queue

17. State the difference between queues and linked lists

18. Define a Deque

19. List the applications of queues

20. Write a routine to display the contents of queue.

Page 8: DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year ... fileDEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I / II ... Define Single Linked list. ... List out the

   

16/10/8 Marks Questions

1. Explain the operations and the implementation of Stack ADT using Array. (16)

2. Explain the different operation that can be performed on Stacks? Write the algorithm for

each operation. (16)

3. Explain the various application of stack? (Balanced parenthesis, Conversion, Evaluation,

Recursion, etc). (16)

4. Explain the operations and the implementation of Stack ADT using Linked list. (16)

5. Convert the infix expression a+b^c+(d*e/f)*g to postfix expression and evaluate the same

using stack. a=3, b=5, c=2, d=7, e=4, f=1, g=8 (16)

6. What is a queue? Write an algorithm to implement queue with example. (16)

7. Explain the operations and the implementation of Queue ADT using Array (16)

8. Explain the different types of queue. (16)

9. Explain the operations and the implementation of Queue ADT using Linked list. (16)

10. Explain Prefix, Infix and postfix expressions with an example.