CC4 Reviewer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

STACKS

Stacks

• A stack is also known as a Last-In-First-Out (LIFO) list.


• A stack is a linear structure in which items are added or removed only at one end the top.
• The depth of stack is the number of elements it contains.
• An empty stack has depth zero.
• Homogenous
• Elements are ordered
• Stack user cannot have direct access to data items inside the stack
• Only topmost item can be retrieved
• Can hold any number of data items (in principle), however, there is an upper limit to stack size depending on the
memory space

Stack Abstract Data Type

➢ A list with the restriction that insertion and deletion can be performed only from one end, called the top.

Operations:

Push(x) – insert or push some item “x” onto the stack.

• Before this operation, the stack is often checked if it has enough capacity to accommodate the new item.
• If stack is full, an overflow would occur.

Pop() – removing the most recent item or element from the stack.

• Must ensure that the stack is not empty before this operation.
• If stack contains no item, popping would cause an underflow error.

Top() – returns the copy of the item or element at the top of the stack.

• The item itself is not removed from the stack.


• This operation is also called peek.

IsEmpty() – it will return true if the stack is empty, false otherwise.

• Normally applied before the pop operation to avoid stack underflow.

IsFull() – it will return true if the stack is full, false otherwise.

• Normally applied before the push operation to avoid stack overflow.


• Not used when dynamic memory allocation is used.

Create – generates an empty stack object and reserves necessary storage space.

Destroy – removes all elements from the stack and releases memory allocated to stack.
Algorithm of push()

The process of putting a new data element onto stack is known as a Push Operation. Push operation involves a series of
steps:

• Step 1 − Checks if the stack is full.


• Step 2 − If the stack is full, produces an error and exit.
• Step 3 − If the stack is not full, increments top to point next empty space.
• Step 4 − Adds data element to the stack location, where top is pointing.
• Step 5 − Returns success.

Algorithm of pop()

Accessing the content while removing it from the stack, is known as a Pop Operation. In an array implementation of pop()
operation, the data element is not actually removed, instead top is decremented to a lower position in the stack to point to
the next value. But in linked-list implementation, pop() actually removes data element and deallocates memory space.

• Step 1 − Checks if the stack is empty.


• Step 2 − If the stack is empty, produces an error and exit.
• Step 3 − If the stack is not empty, accesses the data element at which top is pointing.
• Step 4 − Decreases the value of top by 1.
• Step 5 − Returns success.

Array Implementation

• simplified version of the array-based list.


• The only important design decision to be made is which end of the array should represent the top of the stack.
• One choice is to make the top be at position 0 in the array.
• Inefficient implementation because now every push or pop operation will require that all elements currently in the
stack be shifted one position in the array, for a cost of Θ(n) if there are n elements.
• As elements are pushed onto the stack, they are appended to the tail of the list.
• Method pop removes the tail element. In this case, the cost for each push or pop operation is only Θ(1).
• An array of appropriate data type is used to store stack data.
• Size of array determines the maximum number of data elements in the stack.
• A variable top is used to identify the topmost element.
• The elements of stack are placed in a sequential order in the array.
• When an element is pushed onto stack, top is incremented by 1.
• When an element is popped off, top is decremented by 1.
Disadvantages of Array Implementation of Stacks

• Size of stack needs to be specified at compile time.


• If an application requires less space than the array size, storage space will be wasted.
• The program will crash if application requires more storage space at runtime.

Linked-List Implementation

• Elements are inserted and removed only from the head of the list.
• A header node is not used because no special-case code is required for lists of zero or one elements.
• The only data member is top, a pointer to the first (top) link node of the stack.
• Method push first modifies the next field of the newly created link node to point to the top of the stack and then
sets top to point to the new link node.
• Method pop is also quite simple. Variable temp stores the top nodes’ value, while ltemp links to the top node as it
is removed from the stack.
• The stack is updated by setting top to point to the next link in the stack.
• The old top node is then returned to free store (or the freelist), and the element value is returned.

Push

1. Create a new node


2. Copy element to the new node
3. Link pointer of new node is set to point to pre-existing front node
4. Head pointer is re-set to point to the new node

Pop

1. Topmost element is copied for removal


2. A new pointer is created to point to front mode
3. Head pointer is reset to point to the next node
4. Using the new pointer, front node is deleted
Operations:

insertFront(x): inserts an element on the front of the list

1) Allocate a new node.


2) Have new node point to old head.
3) Update head to point to new node.

removeFront(): returns and removes the element at the front of the list

1) Update head to point to next node in the list.


2) Return element of previous head and delete the node.

insertBack(x): inserts an element on the back of the list

1) Allocate a new node.


2) If tail is NULL, update head and tail to point to the new node; otherwise.
❖ Have the old tail point to the new node.
❖ Update tail to point to new node.

removeBack(): returns and removes the element at the end of the list

1) No efficient way of doing.


2) Typically would not use a linked-list if this operation is commonly used.

Stack Applications

• Stacks are extensively used in computer science and other disciplines.


• Stacks play a central role in the following situations.
• Translating and computing high-level computer languages.
• Implementing recursive procedures and recursive functions.
• Implementing search and traversal algorithms.
• Stacks are also used by Text editors, Web browsers and Application packages.

Recursion Implementation

• Perhaps the most common computer application that uses stacks is not even visible to its users. This is the
implementation of subroutine calls in most programming language runtime environments.
• A subroutine call is normally implemented by placing necessary information about the subroutine (including the
return address, parameters, and local variables) onto a stack.
• This information is called an activation record. Further subroutine calls add to the stack. Each return from a
subroutine pops the top activation record off the stack.

Implementing recursion with a stack. β values indicate the address of the program instruction to return to after completing
the current function call. On each recursive function call to fact, both the return address and the current value of n must be
saved. Each return from fact pops the top activation record off the stack.

Using Stack for Parentheses Matching

• Parentheses are used in arithmetic expressions to specify priority of evaluation in a valid expression, ‘(‘ match
with a corresponding ‘)’
• The following expression has the same number of ‘)’ and ‘(‘ , but it is illegal.

A+)+(C+D)+(
We can use a stack to validate an expression
using the following algorithm:

1. Scan the expression from left to right

2. If ‘(‘ is encountered, push it onto the stack

3. If ‘)’ is found, pop the stack

4. If stack is empty, report a mismatched ‘)’

5. If stack is not empty at the end of the scan,


report mismatching error

Performance of Stack Implementation

• Array scheme is suitable for stacks with fixed number of data items. Its implementation is simple.
• By contrast, the linked list implementation is complex but flexible.

❖ It involves creation and deletion of front node.


❖ It is preferable when size is unpredictable.

• In both implementations, amount of storage space is proportional to number of elements.


• In Big-Oh notation, space efficiency of either implementation is O(N).
• In array implementation, all stack operations involve manipulating only the first element.

❖ It is independent of the number of elements in the array.


❖ Time efficiency is O(1).

• List-based implementation also involves manipulating a single node at the front.


• It is independent of the number of nodes thus time efficiency is O(1).
• Delete operation has time efficiency of O(N), because N nodes are deleted to release storage space.

Advantages of Stacks

• Helps manage the data in particular way (LIFO) which is not possible with Linked list and array.
• When function is called the local variables are stored in stack and destroyed once returned. Stack is used when
variable is not used outside the function.
• It gives control over how memory is allocated and deallocated.
• Stack frees you from the burden of remembering to cleanup(read delete) the object.
• Not easily corrupted (No one can easily inset data in middle).

Disadvantages of Stacks

• Stack memory is limited.


• Creating too many objects on the stack will increase the chances of stack overflow.
• Random access not possible.

Algebraic Expression

• An algebraic expression is a legal combination of operands and the operators.


• Operand is the quantity (unit of data) on which a mathematical operation is performed.
• Operand may be a variable like x, y, z or a constant like 5, 4,0,9,1 etc.
• Operator is a symbol which signifies a mathematical or logical operation between the operands. Example of
familiar operators include +,-,*, /, ^
• An example of expression as x+y*z.
• INFIX: the expressions in which operands surround the operator, e.g. x+y, 6*3 etc. This way of writing the
expressions is called infix notation.

• POSTFIX: Postfix notation are also known as Reverse Polish Notation (RPN). They are different from the infix and
prefix notations in the sense that in the postfix notation, operator comes after the operands, e.g. xy+, xyz+* etc.

• PREFIX: Prefix notation also known as Polish notation. In the prefix notation, operator comes before the operands,
e.g. +xy, *+xyz etc.

Tie Breaker

➢ When an operand lies between two operators that have the same priority, the operand associates with the
operator on the left.

a+b–c

a*b/c/d

Delimeters

Sub expression within delimiters is treated as a single operand, independent from the remainder of the expression.

(a + b) * (c – d) / (e – f)

Why?

• Why use PREFIX and POSTFIX notations when we have simple INFIX notation?

INFIX notations are not as simple as they seem, specially while evaluating them. To evaluate an infix expression, we need
to consider Operators’ Priority and Associative property

E.g. expression 3+5*4 evaluate to 32 i.e. (3+5)*4 or to 23 i.e. 3+(5*4).

To solve this problem Precedence or Priority of the operators were defined. Operator precedence governs evaluation
order. An operator with higher precedence is applied before an operator with lower precedence.

Infix Expression is Hard to Parse

1. Need operator priorities, tie breaker, and delimiters.

2. This makes computer evaluation more difficult than is necessary.

3. Postfix and prefix expression forms do not rely on operator priorities, a tie breaker, or delimiters.

4. Both prefix and postfix notations have an advantage over infix that while evaluating an expression in prefix or postfix
form, we need not consider the Priority and Associative property (order of brackets).

E.g., x/y*z becomes */xyz in prefix and xy/z* in postfix. Both prefix and postfix notations make Expression
Evaluation a lot easier.

5. So it is easier to evaluate expressions that are in these forms.

Examples of infix to prefix and postfix


Examples of infix to prefix and postfix

1. Postfix notation is another way of writing arithmetic expression.

2. In postfix notation, the operator is written after the two operands.

infix: 2+5 postfix: 2 5 +

3. Expressions are evaluated from left to right. Precedence rules and parentheses are never needed!!

Suppose that we would like to rewrite A+B*C in postfix

Applying the rules of precedence, we obtained.

Postfix Examples

Why? No brackets necessary!

Algorithm for Infix to Postfix

1. Examine the next element in the input.

2. If it is operand, output it.

3. If it is opening parenthesis, push it on stack.

4. If it is an operator, then

i. If stack is empty, push operator on stack.

ii. If the top of stack is opening parenthesis, push operator on stack

iii. If it has higher priority than the top of stack, push operator on stack.

iv. Else pop the operator from the stack and output it, repeat step 4

5. If it is a closing parenthesis, pop operators from stack and output them until an opening parenthesis is encountered.
pop and discard the opening parenthesis.

6. If there is more input, go to step 1

7. If there is no more input, pop the remaining operators to output.


Suppose we want to convert 2*3/(2-1)+5*3 into Postfix form

Evaluation a postfix expression

1. Each operator in a postfix string refers to the previous two operands in the string.

2. Suppose that each time we read an operand we push it into a stack. When we reach an operator, its operands will then
be top two elements on the stack

3. We can then pop these two elements, perform the indicated operation on them, and push the result on the stack.

4. So that it will be available for use as an operand of the next operator.

Evaluation a postfix notation

1. Use a stack to evaluate an expression in postfix notation.

2. The postfix expression to be evaluated is scanned from left to right.

3. Variables or constants are pushed onto the stack.

4. When an operator is encountered, the indicated action is performed using the top elements of the stack, and the result
replaces the operands on the stack.
Evaluating a postfix expression

1. Initialize an empty stack

2. While token remain in the input stream

❖ Read next token


❖ If token is a number, push it into the stack
❖ Else, if token is an operator, pop top two tokens off the stack, apply the operator, and push the answer back into
the stack

3. Pop the answer off the stack.

Algorithm for evaluating a postfix expression (Cond.)

Question: Evaluate the following expression in postfix: 623+-382/+*2^3+

Algorithm:

Initialize result as a blank string, Iterate through given expression, one character at a time

1. If the character is an operand, add it to the result.


2. If the character is an operator.

o If the operator stack is empty then push it to the operator stack.


o Else If the operator stack is not empty,

i. If the operator’s precedence is greater than or equal to the precedence of the stack top of the operator stack, then
push the character to the operator stack.
ii. If the operator’s precedence is less than the precedence of the stack top of operator stack then “pop out an operator
from the stack and add it to the result until the stack is empty or operator’s precedence is greater than or equal to
the precedence of the stack top of operator stack“. then push the operator to stack.

3. If the character is “(“, then push it onto the operator stack.


4. If the character is “)”, then “pop out an operator from the stack and add it to the result until the corresponding “(“ is
encountered in operator stack. Now just pop out the “(“.
QUEUES

CC4 Data Structure and Algorithms

Queues

• is a list-like structure that provides restricted access to its elements. Queue elements may only be inserted at the
back (called an enqueue operation) and removed from the front (called a dequeue operation). Queues operate like
standing in line at a movie theater ticket counter. They call a queue a “FIFO” list, which stands for “First-In, First-
Out.”

Queue ADT (Abstract Data Structure)

• Feature/ Operations
• No Implementation details

Sample Picture of Queues

In real world, a queue is a structure goes in first, comes out first or called FIFO.

A stack which is call Last in First Out Structure (LIFO)

A stack is a collection in which both insertion and removal happen on the same end that we called pop out stack.

In Queue, however an insertion must happen at one end that we call rear or tail of the queue and any removal must happen
at the other end called front or end of the queue

Queue ADT and Operations

• a List or collection with the restriction that insertion can be performed at one end (rear) and deletion can be
performed at the other end (front).

Operations

• EnQueue(x)
• DeQueue()
• Front()
• IsEmpty
• Logically a Queue can be shown as a figure or container, open from two sides, so an element can be inserted or
enqueued from one side and can be remove or dequeued on the other side.

Example: Queue of Integers

(See slide 9 of the QUEUE PPT and present it)

Example 2: Printer on a network

• A Printer shared on a network. Any machine on the network can send print request on the printer but it can only
print one request at a time. When a request comes and the printer is busy, the printer will not say that can’t you see
I’m busy, what really happens is the program will put the request in a queue.

ARRAY IMPLEMENTATION OF QUEUE

Queue Implementation

(The animation of this is at slide 13)


Circular Array Queue

(The animation of this is at slide 14)

Linked List Implementation: Queue

(The animation of this is at slide 16)

The linked queue implementation is a straightforward adaptation of the linked list. Methods front and rear are pointers to
the front and rear queue elements, respectively. We will use a header link node, which allows for a simpler implementation
of the enqueue operation by avoiding any special cases when the queue is empty. On initialization, the front and rear
pointers will point to the header node, and front will always point to the header node while rear points to the true last link
node in the queue. Method enqueue places the new element in a link node at the end of the linked list (i.e., the node that
rear points to) and then advances rear to point to the new link node. Method dequeue removes and returns the first element
of the list.
SORTING

Bubble Sort, Selection Sort, Insertion Sort, and Merge Sort

SEARCHING

• Given a list of data find the location of a particular value or report that value is not present
• linear search
✓ intuitive approach
✓ start at first item
✓ is it the one I am looking for?
✓ if not go to next item
✓ repeat until found or all items checked
✓ If items not sorted or unsortable this approach is necessary

Linear Search

Searching in a Sorted List

• If items are sorted then we can divide and conquer


• dividing your work in half with each step
✓ generally a good thing

Sorting

• A fundamental application for computers


• Done to make finding data (searching) faster

Sorting Categories

1. Internal Sorting – The data collection to be sorted is kept in the main memory.

2. External Sorting – The sorting of data stored on secondary devices. Data is sorted in the main memory and written back
to the secondary device.

Internal Sorting External Sorting


In Internal sorting, all the data to sort is stored in In External sorting, data is stored outside
main memory at all times while sorting is in memory (like on disk) and only laded into memory
progress. in small chunks.
It is performed when the data to be sorted is small External sorting is usually applied in cases when
enough to fit in main memory. data can’t fit into main memory entirely.
In other words, it is used when size of input is In other words, It is used when size of input is
small. large.

In this method, the storage device used is only In this method, the storage devices are both
Main memory (RAM). Secondary memory (Hard disk) and Main Memory
(RAM).
Examples: Example:
Bubble sort, Insertion sort, Quick sort, Heap sort External Merge Sort.
etc.
Bubble Sort

• Bubble sort is the simplest iterative algorithm operates by comparing each item or element with the item next to it and
swapping them if needed. In simple words, it compares the first and second element of the list and swaps it unless they
are out of specific order. Similarly, Second and third element are compared and swapped, and this comparing and
swapping go on to the end of the list.

• The number of comparisons in the first iteration are n-1 where n is the number elements in an array. The largest element
would be at nth position after the first iteration. And after each iteration, the number of comparisons decreases and at last
iteration only one comparison takes place.

Advantages and Disadvantages of Bubble Sort

Advantages Disadvantage/s
It is easy to understand Sorting takes a long time
Easy to implement
No demand for large amounts of memory
Once sorted, data is available for processing

Bubble Sort: Performance

The best-case scenario is depicted by O(n). In this instance, the algorithm executes in a time directly proportional to the
size of the array. The worst-case scenario of its operation occurs when the array needs to be 'reverse sorted' and is
depicted by O (n^2) where the time increases exponentially as the number of sorted elements increase

Bubble Sort: Efficiency

The Bubble sort is the simplest sorting algorithm. But it is also the slowest of all. Let’s have a look about its efficiency.
Let’s have an array of size 10 to be sorted.

In the first pass of the loop it makes 9 comparisons, and with the second pass it makes 8 comparisons, and so on, down
to one comparison on the last pass. So, for 10 items, it makes:

9+8+7+6+5+4+3+2+1 = 45
Selection Sort

Selection sort has achieved slightly better performance and is efficient than bubble sort algorithm. Suppose we want to
arrange an array in ascending order then it functions by finding the largest element and exchanging it with the last
element and repeat the following process on the sub-arrays till the whole list is sorted.

In selection sort, the sorted and unsorted array does not make any difference and consumes an order of n2 (O(n2)) in
both best- and worst-case complexity. Selection sort is faster than Bubble sort.

Advantages and Disadvantages of Selection Sort

Advantages Disadvantages
The main advantage of the selection sort is that it The primary disadvantages of the selection sort is
performs well on a small list. its pore efficiency when dealing with a huge list of
items.
Because it is an in-place sorting algorithm, no The selection sort requires n-squared number of
additional temporary storage is required beyond steps for sorting n elements.
what is needed to hold the original list.
Its performance is easily influenced by the initial Quick Sort is much more efficient than selection
ordering of the items before the sorting process. sort

Selection Sort: Performance

Selection sort loops over indices in the array; for each index, selection sort calls indexOfMinimum and swap. If the length
of the array is nnn, there are nnn indices in the array.

Since each execution of the body of the loop runs two lines of code, you might think that 2 n2n2, n lines of code are executed
by selection sort. But it is not true!

Remember that indexOfMinimum and swap are functions: when either is called, some lines of code are executed.

Selection Sort: Performance


Selection Sort: Implementation

findMinimumFromUnSortedPart(int[] intArray, int startIndexOfUnSorted) – It finds the smallest element in a given array
from the starting index of the unsorted part. The max operation is N – 1. This step scans all elements. If the elements
change, then have to redo. In this case, Insertion sort is a better choice.

sortAsc(int[] intArray) – It iterates the array and swaps the left-most element in the unsorted part to the smallest element
found for each iteration.

It is like bubble sort but works the other way around. It selects the smallest element from the entire array and moves to the
first position. Then it moves onto finding the smallest among 1 to n and so on till we reach all n positions. Basically, it
selects the element at each position from 0 to n. The worst-case runtime is O(n2) for selection sort as well.

Key Differences Between Bubble Sort and Selection Sort

1. In the bubble sort, each element and its adjacent element is compared and swapped if required. On the other hand,
selection sort works by selecting the element and swapping that element with the last element. The selected element
could be largest or smallest depending on the order i.e., ascending or descending.

2. The worst-case complexity is same in both the algorithms, i.e., O(n2), but best complexity is different. Bubble sort takes
an order of n time whereas selection sort consumes an order of n2 time.

3. Bubble sort is a stable algorithm, in contrast, selection sort is unstable.

4. Selection sort algorithm is fast and efficient as compared to bubble sort which is very slow and inefficient.

Conclusion

Bubble sort algorithm is the most simple and inefficient algorithm, but selection sort algorithm is efficient as compared to
bubble sort. Bubble sort also consumes additional space for storing temporary variable and needs more swaps.

Bubble Sort Vs Selection Sort Comparison Chart

Basis For Comparison Bubble Sort Selection Sort


Basic Adjacent element is compared Largest element is selected and
and swapped swapped with the last element
(in case of ascending order).
Best case time complexity O (n) O (n2)
Efficiency Inefficient Improved efficiency as
compared to bubble sort
Stable Yes No
Method Exchanging Selection
Speed Slow Fast as compared to bubble sort
Insertion Sort

Insertion sort is a simple sorting algorithm that allows for efficient, in-place sorting of the array, one element at a time. By
in-place sorting, we mean that the original array is modified, and no temporary structures are needed. The array is virtually
split into a sorted and an unsorted part. Values from the unsorted part are picked and placed at the correct position in the
sorted part.

Algorithm
To sort an array of size n in ascending order:
1. Iterate from arr[1] to arr[n] over the array.
2. Compare the current element (key) to its predecessor.
3. If the key element is smaller than its predecessor, compare it to the elements before. Move the greater elements one
position up to make space for the swapped element.

Visualize the Sorting

The iteration starts at the index = 1, and checks all values on the left side of the key

5 is greater than 2, hence positions are swapped

As it checks values only on the left side, the new key is now index = 2

As the values on the left side of 12 are all smaller, the new key is index = 3
As all values are less than 12 on its left side, the new key is at index = 4. Same values are not swapped

1 is less than 12, hence the values are swapped

1 is less than 2, hence the values are swapped

The end of the array is reached and now it is sorted

Advantages and Disadvantages of Insertion Sort

Advantages Disadvantages
The main advantage of the insertion sort is its The disadvantage of the insertion sort is that is
simplicity does not perform as well as other, better sorting
algorithm.

It also exhibits a good performance when dealing With n – squared steps required for every n
with a small list. element to be sorted, the insertion sort does bot
deal well with a huge list.

The insertion sort is an in-place sorting algorithm, The insertion sort is particularly useful only when
so the space requirement is minimal. sorting a list of few items.

Implementation of Insertion Sort

1. The first step is to create a method that takes in input the array to be sorted, sort arr as seen in line 3 in the code above.

2. The second step is to create an outer for loop which will iterate over each element of the array as shown in line 5.

3. The third step is to create a separate iterator, j which will check for the ascending order of elements in the list, as shown
in line 7.

4. The fourth step is the inner while loop:

• As shown in line 9 the while loop must satisfy two conditions: the value of j must be greater than 0, and the value
at index j-1, must be greater than the value at index j.
• If this condition holds true then, as shown from lines 11 to 14, the key is set to the value at index j.
• Then the values at j and j-1 are swapped.
• The value of j is reduced by 1 and the loop continues till one of the conditions breaks.

5. This continues for every iteration of the outer for loop till that also breaks.
Merge Sort

1. A merge sort is a type of a divide and conquer algorithm used to sort a given array; this means that the array is divided
into halves and then further sub-divided till division can no longer take place.

2. This happens when you reach a single element array as that has no middle to further divide the array on. Each divided
sub-array is then sorted and subsequently merged with other sub-divisions. The sorted merge continues till all divisions of
the array have been merged, giving us a sorted array.

3. The merge() function is used for merging two halves. The merge(arr, l, m, r) is key process that assumes that arr[l..m]
and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one. See following C implementation for details.

Visualize the Sorting

• Given an array, we need to sort it using Merge Sort. Hence, we must divide the array into half
• Divide the subarrays further
• Divide all subarrays further, except the one on the far right
• Now that all subarrays are of length 1, they can be sorted and merged
• This shows the first sorting step, if an element has a larger value on the left, it is swapped with its partner on the
right
• The subarrays are now merged with one another. When merging the left subarrays, 12 and 10 swap positions as
while merging, sorting takes place again
• The final sorted merge takes place. Giving us, the sorted array

Advantages and Disadvantages of Merge Sort

Advantages Disadvantages
It can be applied to files of any size. Requires extra space >>N
Reading of the input during the run-creation step is Merge Sort requires more space than other sort
sequential ➔Not much seeking.
If heap sort is used for the in-memory part of the Merge sort is less efficient than another sort
merge, its operation can be overlapped with l/0
Implementation of Insertion Sort

The implementation of Merge Sort given above is a recursive one. You start by calling the mergeSort method as shown on
line 51 with the following input parameters:

• The array to be sorted


• The length of the array to be sorted

You might also like