Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8429201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:16:09+00:00 2026-06-10T05:16:09+00:00

I am reading about queues in robert sedwick book on algorithms When the items

  • 0

I am reading about queues in robert sedwick book on algorithms

When the items in the data structure are themselves array indices, so
we refer to such item as “index items”. Typically, we have a set of M
objects, kept in yet another array, that we need to pass through a
generalized queue structure as a part of a more complex algorithm.
Objects are put on the queue by index and processed when they are
removed, and each object is to be processed precisely once. Usually
array indices in a queue with no duplicates accompliches this goal
directly.

My question in last sentence “Objects are put on the queue by index and processed when they are removed, and each object is to be processed precisely once” ? we are using only one array instead of two arrays?

What does author mean by “Usually array indices in a queue with no duplicates accompliches this goal directly.” ?

Thanks for your time and help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:16:11+00:00Added an answer on June 10, 2026 at 5:16 am

    Well, the author wants to address the algorithmic task of processing data that’s stored in an array:

           +-----+-----+---------+-----+
    Data = | Foo | Bar | Grandma | Zip |
           +-----+-----+---------+-----+
    

    We need to process this data in some sort of order that’s determined by our algorithm, and there’s some sort of “to do” queue of items we want to process next. Copying the actual data objects may be undesirable or impossible (objects may be large or uncopyable). A queue of indexes does the trick:

                 --+---+---+--\
    ToDo = [2] --> | 0 | 3 | -----> (1)
                 --+---+---+--/
    

    The queue tells us that Data[1] is the next item to be processed. Data[3] and Data[0] are waiting, and we just decided that Data[2] comes in as the most recent task.

    (For example, queues are used in a breadth-first search of a tree structure: You pop the node that you want to visit next off the queue on one side and push the children of that node in as future work on the other side. Each node should be visited exactly once. The above index queue lets you store the actual tree elements in the Data array, and refer to them by a light-weight index only.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading about FIFO queue array implementeation in Algorithms in C++ by Robert
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning
I'm reading apple's documentation about Memory Management for Dispatch Queues: Even if you implement
I was reading some entries in Eric Lippert's blog about immutable data structures and
I'm reading a book about AI and currently learning about pathfinding(currently doing the Dijkstra
Reading about Kohana templates and saw something I've never seen before: $this->template->title = __('Welcome
Reading about Django, I saw this: http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#ref-contrib-admin - the fancy simple to use admin
Reading about Delphi's Exit statement (see here for instance), I cannot ignore that writing
While reading about exception, I will always come across checked exceptions and unchecked exceptions,
When reading about pipes in Advanced Programming in the UNIX Environment, I noticed that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.