473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

queue problem

A queue is a dynamic restricted data structure that can expand or contract during execution.

Write an abstract data type definition and suitable methods to manipulate a queue, which contains employee information. Employee information consists of Name (String), Emp_no(Numeric), Designation(String), Salary(Numeric)

““emp1.txt” file which consists of 9 records of employees. These records are stored in descending order of Emp_no. It is found that information stored with Emp_no 1905 is incorrect.

Write a complete program to

1. Retrieve the records in “Emp1.txt” file and store then in a queue.
2. Enter the Emp_no of the incorrect record from the keyboard and delete the corresponding record from the queue.
3. Store the modified queue in “Emp1.out” file (this file should contain only 8 records)
Oct 9 '07 #1
2 952
MMcCarthy
14,534 Expert Mod 8TB
As it is possible this is a homework question or at least that it could be used as such I would advise that all answers be in Pseudo code.
Oct 9 '07 #2
jkmyoung
2,057 Expert 2GB
1. Pseudocode is the same as the question.

2. Get input.
Repeat x times, where x is length of the queue:
Pop from queue
If item matches input, discard.
else push it back into the queue
End Repeat.

3. Pseudocode is same as question.
Oct 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Sachin Jagtap | last post by:
Hi, I am getting exception while poping item from queue, I am writing messages coming from client in a queue in one thread and then in other thread i am reading from queue and writing in file....
2
by: Rodrigo García | last post by:
Hi. The problem is a bit hard to explain. I have a ServicedComponent method which runs a distributed transaction consisting on a a MessageQueue reception and several database operations. That...
13
by: Jonathan Amsterdam | last post by:
I think there's a slight design flaw in the Queue class that makes it hard to avoid nested monitor deadlock. The problem is that the mutex used by the Queue is not easy to change. You can then...
0
by: Michael Bayer | last post by:
Hi - i was just going through this thread: http://mail.python.org/ pipermail/python-list/2006-April/336948.html , where it is suggested that the Lock instance used by Queue.Queue should be...
0
by: neonspark | last post by:
I'm buidling some simple macro functionality for my app so the users can record a sequence of keyboard inputs and replay them reliably via some menu. Originally, I used: protected override bool...
3
by: jrpfinch | last post by:
I have a script which is based on the following code. Unfortunately, it only works on Python 2.3 and not 2.5 because there is no esema or fsema attribute in the 2.5 Queue. I am hunting through...
10
by: Craig Buchanan | last post by:
I would like to have a limited pool of objects (the objects are expensive to create) that can be enlisted to process items in a queue. Moreover, I would like to be able to have the processing...
12
by: Paul Rubin | last post by:
I'd like to suggest adding a new operation Queue.finish() This puts a special sentinel object on the queue. The sentinel travels through the queue like any other object, however, when...
0
by: ecestd | last post by:
I did implement the copy constructor but still have a problem with it. It is not working. What could be wrong? #include "QueueP.h" #include <cassert // for assert #include <new // for...
1
by: psaffrey | last post by:
I'm trying to implement an application that will listen for requests, run them when they are present but also be able to add new requests even while it's running. I've tried to do this using the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.