Assignment CoverSheet - English - Edited 1
Assignment CoverSheet - English - Edited 1
Unit Number/Name
19: Data Structures & Algorithms
24/03/2023
Softnet Development Ltd
Student Declaration
One level and each element is related to the element before it and the
element
Next, they are called linear data structures and they are easy to
learn and implement
10 20 30 40 50 60
The data type of array elements
80same
This Array is valid because all data are of the 90 70
type
"Alya
This Array is valid because all data are of "Al "Sara
the same type
a" i" h"
5 " Sarah
This Array is false because it contains a0different
Ali type
" of
data "
First, singly linked lists are the most primitive data structures.
Each node in a single linked list consists of a value and a
reference to the next node
Here is
Atwan the
next item
Here is
Here is the
Atwan the
title of the
next item
previous
A B C
FIRST
FIFO OUT
IN FIRST
initialize()
70 40 50 60
Front\head Rear\Tail
(https://www.naukri.com/learning/articles/queue-data-structure-types-
implementation-applications/, 2023)
The result
Stacks
As for the red book, which was the last item to enter the stack,
its place is at the top of the stack, and it can be taken out
quickly
The operations that are used with the stack are as follows.
The process is by payment
60 push Top))
Stack Stack
The figure above shows the Bush process, where a new element
60 was added to the stack that contains four elements. We note
that the new element 60 has become at the top of the stack.
process pop
Since you only have one end to work with when working at the
top of the stack, removing an element from the stack once more
is referred to as pop. Taking an element out of the top of the
stack is therefore known as a pop operation.
15
(Top)
The last
element 15
stored
The first Pop
14 element 14
on the
is stored
stack 13
on the 13
12 stack 12
Stack Stack
Operation Peek
When performing a peek action, the highest member in the
stack is retrieved without being taken out of the collection of
data elements
The result
LAST
LIFO OUT
IN FIRST
Child
3 4
2
Leaf
Child
5 6 7 8 9
13 Sibling
10 11 12
s
Operations that can be performed on the tree
(https://www.geeksforgeeks.org/data-structures/, n.d.)
[10 3 8 0 4 2]
1-
10 3 8 0 4 2
Key=3//staring from 1st index.
3<10
Result:
3 10 8 0 4 2
2-
3 10 8 0 4 2
Result: [ 3 5 8 1 4 2 ]
Result:
3 8 10 0 4 2
3-
3 8 10 0 4 2
10 > 0 => [ 3 8 0 10 4 2 ]
8>0 => [ 3 0 8 10 4 2 ]
3>0 => [ 1 3 8 10 4 2 ]
Result:
0 3 8 10 4 2
4-
0 3 8 10 4 2
10 > 4 => [ 0 3 8 4 10 2 ]
8 > 4 => [ 0 3 4 8 10 2 ]
0 3 4 8 10 2
5-
0 3 4 8 10 2
10 > 2 => [ 0 3 4 8 2 10 ]
8 > 2 => [ 0 3 4 2 8 10 ]
4 > 2 => [ 0 3 2 4 8 10 ]
3 > 2 => [ 0 2 3 4 8 10 ]
Result:
0 2 3 4 8 10
The code for the insertion sort algorithm in java
Bubble Sort
}
}
}
public static void main(String[] args) {
(https://www.freecodecamp.org/news/sorting-algorithms-explained-with-examples-
in-python-java-and-c/, 2019)
asymptotic analysis
When choosing the right algorithm for the program, we must
take care of many things, including the algorithm's ease of use,
safety, modularity, and maintainability. For our algorithm to be
effective, we must focus and care about the performance of the
algorithm. Before choosing the algorithm, we will evaluate its
performance
Best Case The least amount of time necessary for the software
to run.
Ο Notation
Ω Notation
θ Notation
Big Oh Notation, Ο
omega notation Ω
The formal notation for expressing the lower and upper bounds of an
algorithm's execution time is (n). It is displayed as follows:
logarithmic − Ο(log n)
linear − Ο(n)
quadratic − Ο(n2)
cubic − Ο(n3)
polynomial − nΟ(1)
exponential − 2Ο(n)
1 2n+2
The time complexity of the following algorithm is:
T(n)=1+1+1+2+2n
=2n+5
(https://www.tutorialspoint.com/data_structures_algorithms/
asymptotic_analysis.htm, n.d.)
ADT
first, we will analyze the many types of built-in data available to us.
The inbuilt data types include int, float, double, long, etc., and we
may do operations like addition, subtraction, division,
multiplication, etc. data type. Only when we need it can we define
these processes. Therefore, we can design data structures along
with their operations to simplify the process of handling problems.
Non-embedded data structures are known as Abstract Data Types
(ADT).
The user of a data type does not need to be aware of how that
data type is implemented. For instance, we have been using
primitive values such as int, float, and char data types only with
the understanding that these data types can operate and be
performed without being aware of how they are implemented.
Advantages:
Disadvantages:
Restricted Flexibility: Certain ADTs may not be suited for all sorts
of data structures or may have limited capabilities.
Cost: Putting ADTs into practice would call for more money and
resources, which would raise the price of development.
The result
(https://www.geeksforgeeks.org/abstract-data-types/, n.d.)
ASN
Example:-
FooQuestion :: = SEQUENCE {
trackingNumber INTEGER،
question IA5String
}
FooAnswer :: = SEQUENCE {
questionNumber INTEGER،
answer BOOLEAN
}
END
(https://en.wikipedia.org/wiki/ASN.1, n.d.)
From what I learned in this course for Data Structures, I created
an application for encoding and decoding texts and files, as well
as images. I will explain how my application works
First, the user will see an interface that contains the following
Label
Text
1
box
Label
2
Label
Button
3
First, the user enters the texts he wants to honor in this box, then
he has to click on the encryption button
I have entered my name Alia to try the application, then I will press
the encryption button
The result
Now I will explain the code that I wrote to build the application
(https://www.scaler.com/topics/advantages-of-data-structure/, n.d.)