answersLogoWhite

0


Best Answer

You cannot uses indices instead of subscripts. The subscript operator [] requires an index in order to determine the subscript. Even if you don't use the subscript operator you still need an index to determine the offset of the subscript. Indeed, the only time you do not need an index is when traversing the array using a roving pointer, which is arguably more efficient than using a subscript to traverse an array since subscripts use multiplication instead of the much simpler increment/decrement operation.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why should indexes be used instead of subscripts to identify array elements?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you use subscripts with an array?

An array is a list of several related elements. You use the subscript to specify which element you want to access. For example, in Java you might have an array called myArray, with 10 elements (numbered from 0 to 9); myArray[3] would access the fourth element in the array. A variable may be used instead of a constant.


Just-in-time operations and simultaneous engineering are key elements of time-based competition?

If you were trying to find the answer to your test questions yourself instead of ask.com you might actually go somewhere in life


How do you delete element from a stack?

Stacks are typically implemented as singly-linked lists, where new elements are pushed onto the tail of the list. Thus only the tail needs to be maintained. To remove an element you simply pop the tail element. Note that some implementations only maintain the head element, thus elements are pushed onto or popped from the head instead.


Advantage of linked list over array?

The only real advantage a linked list has over an array is that it can grow much more efficiently, however this is only guaranteed when new elements are inserted at the head or the tail of the list where you have constant time access. Constant time random access is not possible, thus insertions within the body of the list may be slower than for an array because of the need to traverse to the insertion point. However an array must reallocate in order to make room for new elements which may result in the entire array being moved to new memory. This can be minimised by reserving memory in advance. But, more importantly, all elements from the insertion point must be moved forward in the array in order to make a gap for new elements. Thus inserting into an array can often be slower than for a list, particularly if the elements do not support move semantics (they must be copied instead). If you plan on performing many such insertions, then a list will probably be quicker overall because there is no need to move elements around in memory. However, if you require random access and compact storage, use an array instead and reserve as many elements as you require for your insertions.


Difference between simple queue and circular queue?

Simple queue is a linear queue having front & rear var to insert & delete elements from the list.But there is a boundary that we have to insert at rear & have delete from front.For this reason instead of having space in the queue if there is a single element in the rear,the queue is full.the other space is wasted.To utilize space properly,circular queue is derived.In this queue the elements are inserted in circular manner.So that no space is wasted at all.

Related questions

Why is aluminum used instead of other elements?

used instead of other elements for what?


How do you use subscripts with an array?

An array is a list of several related elements. You use the subscript to specify which element you want to access. For example, in Java you might have an array called myArray, with 10 elements (numbered from 0 to 9); myArray[3] would access the fourth element in the array. A variable may be used instead of a constant.


Why can't you balance an equation by changing the subscripts of the reactants or the products?

You can't change the subscript. The subscripts show how the elements/molecules are bonded.--------------------------------------------------------------------------------------------------------The subscripts represent the number of atoms of each element in each chemical formula-if you change the subscripts, you change the compounds the formulas are describing.Source: (e2020)


Why you use indexes in SQL?

It provides a better and faster method to search a particular item you are looking for. When you issue a select statement to have a particular item with some condition, it searches the whole DB to get the answer for you. Instead if you have some indexes to it, the searching is done faster.


What are some examples of minerals that are elements instead of compounds?

Copper, Silver, and Gold occur as elements instead of compounds.


What are some examples of minerals that occurred as elements instead of compounds?

Copper, Silver, and Gold occur as elements instead of compounds.


What are some examples of minerals occur as elements instead of compounds?

Copper, Silver, and Gold occur as elements instead of compounds.


What are some compounds of minerals that occur as elements instead of compounds?

Copper, Silver, and Gold occur as elements instead of compounds.


How come fusion needs hydrogen instead of other elements?

it does not. you can fuse any elements to each other


How did later chemists change Mendeleevs periodic table?

They used atomic number instead of Atomic Mass to organize the elements


Why are symbols used instead of words to identify hole types?

to save space in dimensioning


Nomadic societies adapted to the elements and focused on what instead of agriculture?

Animals