Computer Science
Study Material For BSc(CS) students.
Home
B.Sc.(CS)
F.Y.B.Sc(CS)
Problem Solving using Computer and ‘C’ Programming
S.Y.B.Sc(CS)
Data Structures and Algorithms I
Notes
Lab Assignments
Data Structures and Algorithms II
Notes
Lab Assignments
T.Y.B.Sc(CS)
Operating System I
Notes
Lab Assignments
Operating System II
Notes
Lab Assignments
M.Sc.(CA)
F.Y.M.Sc(CA)
Operating System
Notes
S.Y.M.ScCA)
Python Programming
Notes
Lab Assignments
Downloads
Syllabus
MCQs
Practice Tests
OS
Sunday, 6 June 2021
DS-(I) Assignment 1: Searching Algorithms
June 06, 2021
DS LAB (I)
No comments
Set A.
a) Create a random array of n integers. Accept a value x from user and use linear search algorithm to check whether the number is present in the array or not and output the position if the number is present.
b) Accept n values in array from user. Accept a value x from user and use sentinel linear search algorithm to check whether the number is present in the array or not and output the position if the number is present.
c) Accept n sorted values in array from user. Accept a value x from user and use binary search algorithm to check whether the number is present in sorted array or not and output the position if the number is present.
Set B.
a) Read the data from file 'cities.txt' containing names of cities and their STD codes. Accept a name of the city from user and use linear search algorithm to check whether the name is present in the file and output the STD code, otherwise output “city not in the list”.
b) Read the data from file 'cities.txt' containing names of cities and their STD codes. Accept a name of the city from user and use sentinel linear search algorithm to check whether the name is present in the file and output the STD code, otherwise output “city not in the list”.
c) Read the data from file ‘sortedcities.txt’ containing sorted names of cities and their STD codes. Accept a name of the city from user and use binary search algorithm to check whether the name is present in the file and output the STD code, otherwise output “city not in the list”.
Email This
BlogThis!
Share to X
Share to Facebook
Newer Post
Older Post
Home
0 Comments:
Post a Comment
Subscribe to:
Post Comments (Atom)
Popular
Tags
Blog Archives
Followers
ABOUT
Rahul Sonawane
Nashik, Maharashtra, India
Qualification: M.Tech (IMCA), NET, SET
View my complete profile
Popular Posts
Powered by
Blogger
.
Wikipedia
Search results
Blog Archive
March
(1)
January
(1)
January
(5)
June
(13)
April
(3)
March
(2)
February
(1)
November
(1)
October
(3)
0 Comments:
Post a Comment