answersLogoWhite

0

Which queue most efficient queue using array?

Updated: 8/19/2019
User Avatar

Wiki User

13y ago

Best Answer

circular queue

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which queue most efficient queue using array?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you implement a FIFO structure?

FIFO is a first-in, first out structure. In other words, it is a queue. The most efficient way to implement a queue is with a circular array.


A travel agent wants a program to store an alphabetical list of winter holiday destinations State the most efficient way to store lists using a programming language?

The most efficient way to store a list is with an array.


What are advantages and disadvantages of merging?

merge sort is the most efficient way of sorting the list of array.


Why are the array and linked list used as stack queue and others?

Arrays are beneficial whenever you need constant-time, random-access to any element within a set of data and the number of elements doesn't change too much (enlarging an array may require the entire array be copied to a larger block of free memory, which is expensive in terms of performance). Linked lists are beneficial when the number of elements is highly variable and you also need constant time access to the head (as per a stack) or both the head and tail (as per a queue). Neither a queue nor a stack requires any traversal whatsoever, so the lack of random access is immaterial. If a set of data is variable and must remain in sorted order (such as a priority queue), then a heap or self-balancing binary tree is the most efficient structure to use.


Is it the most efficient approach to access elements with the vector data structure?

Yes. A vector is a variable-length array but constant-time random-access is guaranteed regardless of an array's length.


How do you print array variable without using array subscripts?

Well the most prolific answer to this query would be the use of pointers.Use a pointer and allocate it to the array of interest and start printing.


What is the most appropriate datastructure to implement priority queue?

Arrays are the most efficient data structure. Memory is allocated to the entire array as a single operation and the total memory consumed is equal to the product of the element size and the number of elements (all elements being of equal size, in bytes). This means that any element in the array can be accessed using simple pointer arithmetic from the start of the array, with the first element at offset 0. All high level languages hide the pointer arithmetic behind an array suffix operator, such that element [5] will be found 5 * sizeof (element) bytes from the start address of the array (the address where element [0] resides). Multi-dimensional arrays are implemented as an array of arrays, such that a two-dimensional array is a one-dimensional array where every element is itself a one-dimensional array. These can be thought of as being a table of rows and columns where the first dimension access a one-dimensional row array, and the second dimension accesses the column within that row. A three-dimensional array can then be thought of as being an array of tables or a cuboid (a stack of tables). A four-dimensional array can therefore be thought of as being an array of cuboids, a table of tables, or a cuboid of arrays. By imagining arrays in this manner it becomes much simpler to imagine arrays with more than 3 dimensions. By contrast, a list or a tree structure is less efficient because every element requires at least one additional field to maintain the link from that element to another element, thus defining the structure. You also need to maintain an additional field to refer to the first element in the structure. If you have a structure that can dramatically vary in size, lists may be more efficient because there is no need to reallocate the entire structure; you simply allocate and deallocate memory for individual elements and update the links between elements to maintain the structure. However, you lose constant-time random access because you have to traverse the links in the structure to locate an individual element and the additional level of indirection means it will be slower than an array. However, reallocating an array often means copying the array to new memory. One way to minimise reallocations is to reserve more memory than you actually need, thus allowing you to add new elements more quickly at the cost of some memory. You only need to reallocate when you run out of reserve. You can also minimise the cost of reallocation by storing pointers rather than objects in your array. This adds an extra level of indirection, but speeds up the reallocation process by only copying pointers rather than objects being pointed.


What is the quick sort program using linked list and recursive methods?

Linked lists are not ideally suited to the quicksort algorithm because linked lists do not provide constant-time random access. The most efficient means of implementing quicksort upon a list is to move all the elements to an array, sort the array using quicksort, then move the elements back into a list. This increases the complexity by O(n*2), which is costly, but is more than compensated for by the improved efficiency of sorting an array.


What does manpower mean?

Using personnel in the most efficient manner possible.


What are the Differences between array and queue?

from the abstraction: list you go to the implementation details (concrete): arraylist,vector or linkedlist,circularlinkedlist and maybe more when somebody asks you for a special list in this case (queue) speciality 1 enqueue -add to botton speciality 2 dequeue - remove from top you are free to pick up arraylist,and/or linkedlist and/or circularlists and/or vector to implement your new specialized list called queue. and/or means you might want to combine as well


What does manpower optimization means?

Using personnel in the most efficient manner possible.


How efficient is Rosetta stone software?

For most users it is quite efficient. However the speed at which you learn using the software is different for everyone.