VOOZH about

URL: https://www.geeksforgeeks.org/dsa/menu-driven-program-for-phone-directory/

⇱ Menu-Driven program for Phone Directory - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Menu-Driven program for Phone Directory

Last Updated : 23 Mar, 2023

Problem Statement: Write a menu-driven program for using switch-case with following features:

  • Store Contact numbers of people
  • Search for the Contact numbers using their names
  • Search for the Contact numbers using their number
  • Delete a Contact number
  • Update a Contact number

Examples:

Approach: The idea is to use switch case for switching the case for menu-driven program for the phonebook directory and store the contact number in the hash-map and search the contact in the hash-map in O(1) time.

Below is the implementation of the above approach:

Output:

👁 Image

Comment
Article Tags: