What is sequential and indexed sequentia in C? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is sequential and indexed sequentia in C?

Googled but didn't find proper answer.

13th Dec 2016, 5:54 AM
Anoop Kumar Prasad
Anoop Kumar Prasad - avatar
1 Answer
+ 1
Which language? In a general context this probably refers to access of collections. For example, let's say you want to access the 5th element of an collection. For collections with sequential access (such as linked lists) you need to start at the 1st element, call next() on that element to get the next, call next() on that, etc - until you get to the 5th element. These typically have O(n) complexity on access. For collections with indexed sequential access (such as vectors) you can simply access by index operator, for example item = collection[4]; There is no need to iterate through all the elements to get to the 5th one. Collections with indexed access are typically O(1) complexity.
13th Dec 2016, 7:04 AM
Ettienne Gilbert
Ettienne Gilbert - avatar