0% found this document useful (0 votes)
5 views

Assignment 01

Uploaded by

Utm Atm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Assignment 01

Uploaded by

Utm Atm
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment01.

md 2023-11-16

Data Structures and Algorithms - Assignment 1


1. Write all possibilites to check palindrome. Also do time and space complexity analysis.

2. Write a linear search algorithm to return index of last occurance of key.

3. Write a program to print no of comparisions done to search a key in i. linear search ii. binary serach

4. Create array of employees and search employee by i. empid ii. name iii. salary

5. Implement binary search algorithm if array is sorted in descending order.

6. Implement linear search algorithm to find the nth occurence of the given element. If nth occurrence is
not found, return -1.

7. find the first non-repeating element: Input: { 1, 2, 3, -1, 2, 1, 0, 4, -1, 7, 8 } Ouput: 3

8. to find rank of an element in a stream of integers. rank: rank of a given integer "x", in stream is "total
no. of ele's less than or equal to x (including x).

Input: { 10, 20, 15, 3, 4, 4, 1 } Ouput: Rank of 4 is: 4

9. Write a selection sort function to sort array and returns no of comparisions.

1/1

You might also like