Collection - Sequence (Ordered)

Data System Architecture

About

A sequence is an abstract collection:

  • of non-unique element
  • where order matters - ie (A,B) is not equal to (B,A)

non-unique means that it allows duplicate member (the same element/value may occur more than once).

Order matter for equivalence Duplicate is allowed Collection Type
false false set
false true Bag
true false OrderedSet
true true Sequence

Example

  • (M, A, R, Y) is a sequence of letters with the letter M first and Y last.
  • (M, A, R, Y) differs from (A, R, M, Y)

Properties

Rank / Index

The position of an element in a sequence is its rank or index.

Cardinality

Collection - Cardinality (Size/Length) - In computer science

Finite

A finite sequence is called a list

Infinite

A infinite sequence is called a stream and is generally read through a iterator pattern.

Access type

It's a data structures with no or slow random access.

Documentation / Reference





Discover More
Java Conceptuel Diagram
Java - Sequence

From a stream of integer (ie a java/util/stream/IntStreamIntStream) 5 questions mark
Data System Architecture
Tree - (Recursion|Induction) Algorithm

A recursive algorithms invoke themselves as a subroutine with a smaller input. The idea of the recursion tree method is to write out all of the work done by the recursive algorithm in a tree structure,...



Share this page:
Follow us:
Task Runner