0% found this document useful (0 votes)
35 views12 pages

Experiment 1

Uploaded by

pranav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views12 pages

Experiment 1

Uploaded by

pranav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Delhi Technological University

IT DATA STRUCTURE G2 LAB

Practical File
Experiment – 1

Name: Prabhav Kumar


Roll no.: 2k22/ec/167
Teachers Name: Mrs. Bindu Verma
Q1: Write a function that accepts as input a string and determines the frequency of
occurrences of each of the distinct characters in the string. Test your function using
suitable data.
Code :
Output:

Q2: Write a function, strmdel, that accepts a string and two integers, start and length.
Return a new string that is equivalent to the original string, except that length
characters beginning at start have been removed.
Code:
Output:

Q3: Write a function, strdel, that accepts a string and a character. The function
returns the string with the first occurrence of the character removed.

Code:
Output:

Q4: Write a program (WAP) with a function to swap two numbers using call by
reference.
Code :
Output:

Q5: Write a program (WAP) with a function to swap two integer arrays of the same
size using call by reference.
Code:
Output:
Q6: Write a program (WAP) to reverse an array by swapping (without using
additional memory).
Code :
Output:

Q7: Write a program (WAP) with a function to swap two strings using pointers.
Code:
Output:

Q8: Write a program (WAP) to find the number of non-repeated elements in an array.
Code:
Output:

Q9: Write a program (WAP) to identify the missing numbers in a given array within
the range [1…N].
Code:
Output:

You might also like