Thursday, March 12, 2015

Assignment on List and Set

There are few employees with below details:

Emp Id
Emp Name
Designation
Salary
Address
Qualification
Department
1
XXXX
SSE
50000
1, 2nd st, NY
B.Tech
IT
2
AAAA
PM
100000
101, 22nd st, DS
M.Tech
ADMIN
3
BBBB
SE
25000
1, 23rd  st, NY
BE
IT
4
YYYY
GM
120000
123, 2nd st, NY
MBA
SALES
5
CCCC
DM
150000
2121, 2nd st, NY
MBA
OPERATION
2
AAAA
PM
100000
101, 22nd st, DS
M.Tech
ADMIN

1. Add this to list and Sort it Alphabetical order. Remove if there is any duplicate. display the index of the employee "BBBB". Dont use Set.

2. The same example use set to sort it and to remove duplicates.

No comments:

Post a Comment