Sunday, December 6, 2020

Q2

CMSACOR05P: Data Structures Lab


 2. WAP using templates to sort a list of elements. Give user the option to perform sorting using Insertion sort, Bubble sort or Selection sort.

Q1

 CMSACOR05P: Data Structures Lab

1. Write a program to search an element from a list. Give user the option to perform Linear or Binary search. Use Template functions.

Monday, November 30, 2020

9. WAP to print a triangle of stars as follows (take number of lines from user):

 9. WAP to print a triangle of stars as follows (take number of lines from user): 

                          *
                       ***
                     *****
                   *******
                 *********


5. Write a function that checks whether a given string is Palindrome or not. Use this function to find whether the string entered by user is Palindrome or not.

 5. Write a function that checks whether a given string is Palindrome or not. Use this function to find whether the string entered by user is Palindrome or not.



6. Write a function to find whether a given no. is prime or not. Use the same to generate the prime numbers less than 100.

 6. Write a function to find whether a given no. is prime or not. Use the same to generate the prime numbers less than 100.




7. WAP to compute the factors of a given number.

 7. WAP to compute the factors of a given number.




8. Write a macro that swaps two numbers. WAP to use it

 8. Write a macro that swaps two numbers. WAP to use it



4. WAP to compute the sum of the first n terms of the following series, S =1-2+3- 4+5…………….

 4. WAP to compute the sum of the first n terms of the following series, S =1-2+3-

4+5…………….

3. WAP to compute the sum of the first n terms of the following series, S=1+1/2+1/3+1/4+……

 3. WAP to compute the sum of the first n terms of the following series,

S=1+1/2+1/3+1/4+……

2.WAP to reverse a number.

 2.WAP to reverse a number.