Construct a database of many cricket/football teams that are organised in a lexicographical order (limited to the first letter) using a doubly linked list. A pointer, HEAD, points to the first element of this list. For each team, there are many players. These players are also organised as an ordered doubly linked list and this list is linked from the team node.

The Team Node consists of only the teamname information.

The Player Node consists of the following information:

for cricket: Player Name Batsman/Bowler/Allrounder Average

for football: Player Name Fullback/Midfielder/Forward Goals scored

Use enumerated data type for the type of player.

The program should allow the operations as described below:

TEAM MENU:

It should first display a menu which is for a team. This menu allows a user to add, delete, modify, list the teams or quit.

For add operation, it should accept the name of the team. If the team is already in the database, it should return an error. Otherwise, it should display a new menu for player operations. This new menu will have add, delete, modify, list and return to main menu options. The add, delete, modify and list are for the players within the team which is being added.

Similar to the add operation for a team, the modify operation should accept the team name. If the name is not found, it should return an error. Otherwise, it displays the player menu as in the add operation above.

For the delete operation on a team, the name of the team is accepted as input. If the team is not found, it returns an error. If it is found, the team is deleted. [NOTE: Please take care that all players in the team are deleted. Otherwise, it leads to memory leaks. Memory leaks will lose you points.]

For the list operation, walk through the team list and print the names of all the teams. This does not require you to list all players in each team. Just list all the teams.

PLAYER MENU:

As stated above for the add team operation, this menu also consists of add, delete, modify and list operations. In addition, it allows you to return to the main menu.

For add operation, accept a player name, the type of player (this has to be mapped to the enumerated type value from user input), the average or goals scored. If the player already exists in the team, return an error. If not, add the record in the lexicographic order.

For modify operation, accept the player name. If the player does not exist in the team, return an error. If not, accept the type of player (this has to be mapped to the enumerated type value from user input), average or goals scored and modify the record with the new data.

For delete operation, accept the player name. If no such player exists, return an error. If not, delete the record.

For list operation, walk through the list of players and print the player records until the end of the list.