/country_listing-using-dsa

This program implements a simple stack data structure to manage a list of countries

Primary LanguageC

country_listing-using-dsa

Country Listing Project

This program implements a simple stack data structure to manage a list of countries. Users can push a country onto the stack, pop a country from the stack, search for a country by name, and display the list of countries.

Data Structure:

The program uses a stack to store countries, where each country is represented by a structure with a character array to store its name. The maximum size of the stack is defined by MAX_Country_SIZE.

Functions:

  1. push(): Adds a new country to the top of the stack.
  2. pop(): Removes the country from the top of the stack.
  3. search(): Searches for a country by name in the stack.
  4. display(): Displays the list of countries in the stack.
  5. main(): The main function presents a menu to the user and calls corresponding functions based on the user's choice.

Usage:

  1. Compile the program using a C compiler (e.g., gcc).
  2. Run the compiled executable.
  3. Follow the on-screen menu to perform operations on the country stack.
  4. Choose the 'Exit' option to end the program.

Notes:

The program does not handle spaces in country names during input. It assumes a single word as the country name. The stack size is limited to MAX_Country_SIZE, and attempting to push more countries than the defined size will result in a stack full message. The search function performs a case-sensitive comparison when searching for countries by name.

Author:

Ashiqur Rahman

  • Group 04

    Date : 03-12-2023