

InterviewSolution
Saved Bookmarks
1. |
Link is an entity which can hold a maximum of 100 integers. Link enables the user to add elements from the rear end and remove integers from the front end of the entity. Define a class Link with the following details: Class name: Link Data Members/instance variables: Ink []: entity to hold the integer elements, max: stores the maximum capacity of the entity, begin: to point to the index of the front end. end: to point to the index of the rear end. Member functions:Link(intmm): constructor to initialize max = mm. begin = 0. end = 0. void addlink (int v): to add an element from the rear index if possible otherwise display the message “OUT OF SIZE… ” int dellink(): to remove and return an element from the front index. if possible otherwise display the message “EMPTY …” and return – 99. void display(): displays the elements of the entity.What type of data structure is the above entity? |
Answer» It is a Queue. |
|