You are on page 1of 1

Practice Assignment -Technical Paper 1 -DSC

1. Write a menu driven program to perform various array operations :


1. Create 2.Display 3. Insert 4.Delete 5.Search 6.Sort 7.exit
2. Write a menu driven program to create a singly linked list of employee
(empid, name, salary) and provide following operation:
1. Add Employee at beginning
2. Add Employee at given position
3. Delete the Employee from end
4. Search employee by salary
5. Display all employees.
6. Exit
3. Create a singly linked with given integer numbers. Subtract sub-sequent
numbers and result as next node immediately after them. Count number of
negative terms in the resultant linked list.
For example:
Given numbers: 3, 5, 8, 2, -4, 5, 7.
Resultant linked list: 3  5 -2 8 2 6 -4 5 -9 7.
Number of negative numbers: 3
4. Create a singly linked with given integer numbers. Traverse the linked list in
reverse order. While traversing, if negative number appears on even
position, then delete all such numbers.
For example:
Given numbers: -3, -5, -8, -2, 4, 6, -7.
Positions from reverse: 7, 6, 5, 4, 3, 2, 1.
Resultant linked list: -3, -8, 4, 6, -7.
5. Create an array of given positive numbers. Find unique elements from that
array. All deleted elements should be at the end of array and marked as -1.
Do not sort the array elements.
For example:
Given numbers: 4, 2, 5, 6, 2, 4, 2, 5, 2, 1.
Resultant array: 4, 2, 5, 6, 1, -1, -1, -1, -1, -1.

You might also like