R22
QP Code: R22A12CS01
Anurag University
B Tech I Year II -Semester End Examinations, July-2023
Course: Programming for Problem Solving - II
(Common to CE, EEE, ME, AI, AIML, CSE-CS, CSE-DS & IT)
Time: 150 Min. Max Marks: 50
Section – A (Short answer type questions)
• Answer all questions: (5 x 2 =10 Marks)
1. Illustrate typedef with suitable coding snippet.
2. How do we Access Elements of an Array Using Pointer?
3. Compare and Contrast Binary file and text file.
4. Draw the stack structure in each case when the following operations are
performed on an empty stack.
(a) Add A, B, C, D, E, F (b) Delete two letters
(c) Display the remaining elements.
5. Write the advantages of binary search over linear search.
Section—B (Essay answer type questions)
• Answer all questions (5 x 8 =40 Marks)
6. A) What do you understand by union? How to access the members of union?
And give the applications of it. 8M
OR
B) i) Explain the concept of an enumerated data type with the help of an
example Program. 4M
ii) How to pass the structures to functions as an argument? Explain. 4M
7. A) i) Describe the call-by-reference parameter passing method. 3M
ii) Discuss about dynamic memory allocation and its functions with suitable
examples 5M
OR
B) Develop a program to create a pointer to employee structure that consists of
employee number, name, salary as members, then read and display the employee
information using the pointer to structure. 8M
8. A) i) Explain the following operations of file open, close, read with examples 5M
ii) Write about fseek() and ftell() functions. 3M
OR
B) i) Develop a program to perform addition of two numbers. accept the input
from command line arguments. 4M
ii) Develop a program to copy content form one file to another. 4M
9. A) Describe the basic operations which are performed on Stack with a program.
8M
OR
B) i) Explain the queue and its operations with an example. 5M
ii) Write the differences between linear and nonlinear data structures. 3M
10. A) Write an algorithm to insert and delete a node in a singly linked list and
discuss with neat diagram and example. 8M
OR
B) i) Give an algorithm for insertion sort and explain the process by tracing the
algorithm for the data: 65 70 75 80 85 60 55 50 45. 5M
ii) Discuss various choices available for selecting the pivot element in quick
sort. 3M