Sir, how are you. I hope that you are fine and working hard. Firstly I am very thankful to you that you answer me. You are my best Expert. Dear Respected Sir I live in Pakistand and I am student of BCS. I am reading the subject Data Structure so I ask a question from you. Dear Respected Sir I have problem some time to slove the problem if you can help then i can slove these problem.

     Dear Respected Sir, If you have you Yahoo or Hotmail ID then you give me I add you in my messenger so that we disscuss some problem. I hope that you give me. I again say that you are my best Expert. Thanks for your answer. I wait for you answer.

         Take Care
         Your Student,
         Imran Ahmad Mughal  

Followup To
Question -
Sir I have question about the Data Structure. Sir Read the Paragraph. Dear Respected Sir, you have to find which data structure is appropriate for a particular aspect and why. Do you think there is a better alternative to improve the stock procedure of the sweet shop? Sir Explain your answer in 20 or 22 lines.

   The Pargraph is as,

         SWEET SHOP

There is a big sweet shop with separate doors for “Entry” & “Exit.” It has various kinds of sweets displayed in neat trays which are placed in showcases. The showcases are arranged with plenty of space in between for customers to walk and choose their favorite sweets easily. One salesman stands behind each showcase to serve the customers.

Once the customer makes a choice, the salesman packs the sweets in the box and sends it to the main counter. The customer stands in a queue for payment. When he makes payment, he is given a receipt with “Paid” printed on it along with his box of sweets.  

The arrangement of sweets in the showcases is such that when a fresh stock arrives, it is placed before the old stock so that the fresh sweets may be sold prior to old ones.

If a customer does not want to wait for his turn and needs quick service, he can get his sweets from the counter by paying 10% extra amount. The condition of 10% extra charges not only ensure speedy service for customers in a rush but also discourage any abuse of this facility.

Dear Respected Sir, Explain your answer with some potential in 20 or 22 lines.


         Your Student,
         Imran Ahmad Mughal

Answer -
Dear Imran,
Thankyou for your question.

Well, i have gone through this assignment problem carefull.
let me see what i can help you in it. Imran, you need to
see one important point here. This shop follows the rule
of first in first out. That means that, the coustomer who
is gonna enter first, will ofcourse find the sweeets first
and he is gonna go the payment counter and will be served
first and he will be the most prior one to exit. I guess
the initial aspect is clear to you that this problem can
best be solved by using a Queue.

Now more depthly, if you indulge into the details, you will
find out there are two kind of priority services avaiable.

a) Priorities related to Newly Arrived Sweets
b) Priority Related to Service.

Plus you should be knowing that, there are types of queues
in which comes a type, which is known as priority queue,
so the Queue which should be handeled in this case is

Priority Queue.
Means that the newly arrived sweeets have priority over
old ones, and the cosutomers which will pay 10% more will
be served first, so they also have a priority over odinary
customers. I hope this logic helps you a little in problem domain.

Where do you live, and what is your major in studies.

Dear Imran,
Thank you for your kind remarks. I appreciate your
comments and your gesture. Okay so you have a major
of Computer's that's interesting.

Imran, you can have my yahoo id. I will try to help
in your queries, if i can. My Yahoo id is


My major is also computer's, and i am doing my final
year from Newyork State Unversity, and specializing
in image processing and Java as well. My major is Java.
So if any queries, you can contact me out.



All Answers

Answers by Expert:

Ask Experts




I can answer any question about functions,pointers,structures,object oriented programming basics of classes and data structures.My strong field is structured programming.


I have got 2 years experiece under C . I am able to answer about the structured concepts pointers to a little extent,OOP concepts. I have also experience in data Strucutres like Linked List, Stacks , Queues, Heaps, B Trees, Red Black Trees. I will try to satisfy with my knowledge. I am the Student of an expert here Martin, what i have learnt today, i just owe my every knowledge to him. He is the greatest.

©2016 About.com. All rights reserved.