Problem Solving Methods 17CS1103 PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

17CS1103 VR17 Reg.

No:

ii) (i*j) + k/l) VELAGAPUDI RAMAKRISHNA


SIDDHARTHA ENGINEERING COLLEGE
iii) (i*(j+k)*l (AUTONOMOUS)
iv) i  j* i  j I/IV B.Tech. DEGREE EXAMINATION, DECEMBER, 2018
First Semester
1 5 9 13
2 17CS1103 PROBLEM SOVING METHODS
6 10 14
b. i) Let matrix A of size (4 x 4) be defined as A   .
3 7 11 15 Time: 3hours Max. Marks: 70
 
4 8 12 16 Part-A is compulsory
Answer One Question from each Unit of Part-B
Reshape the matrix A into matrix B of the size (8 x 2). 4M
Answer to any single question or its part shall be written at one place only
ii) What is the difference between a script file and a function file?
3M PART-A
10 x 1 = 10M
***
1. a. Define flow chart.
b. What is an algorithm?
c. What are the components required to construct any loop?
d. What is Fibonacci sequence?
e. Write the general form of while loop.
f. Which problem-solving strategy is used to solve binary search?
g. Define workspace.
h. List any two major components of the MATLAB.
i. Write any three relation operators in MATLAB.
j. What are the fundamental data types in MATLAB?

Page 4 of 4 Page 1 of 4
17CS1103 VR17 17CS1103
PART-B UNIT-III
4 x 15 = 60M
6. a. Write briefly about Arrays. 7M
UNIT-I
b. Develop an algorithm to find the maximum element from an array.
2. a. Explain the different problem-solving strategies of an 8M
algorithm. Write an algorithm for addition of two numbers. 8M
(or)
b. Discuss various ways for termination of loops with an
example. 7M 7. a. Design an algorithm to search an element from an array using
Linear Search. 7M
(or)
b. Develop an algorithm to sort the list of elements into
3. a. How to analyze algorithm? Write the different characteristics of non-descending order using Selection Sort. 8M
top-down approach. 8M
UNIT-IV
b. What is time and space complexity? Explain worst and average
case behavior of an algorithm. 7M 8. a. Write the MATLAB statements to calculate the sum of the series:

UNIT-II x 2 x 4 x 6 x8
s  1    7M
2! 4! 6! 8!
4. a. Develop an algorithm for the given two variables a and b,
exchange their values with using a third temporary variable. 8M 6 7  1 
b. Let A    , x    and y  3 4 8M
8 9  2
b. Design an algorithm to compute the average of n numbers. 7M
i) Append the vector x as new column of A and store in matrix B.
(or)
ii) Append the vector y as new row of A and store in matrix C.
5. a. Write the steps involved in solving greatest common divisor
problem. 8M (or)

b. Design an algorithm to print prime numbers in the first n 9. a. The variables i, j, k and l have values equal to 2, 3, 4 and 5
positive integers. 7M respectively. Evaluate the following MATLAB expressions: 8M
i) i*j + k*l
Page 2 of 4 Page 3 of 4

You might also like