Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Data Structure and Algorithm

Rating
-
Sold
-
Pages
24
Uploaded on
03-03-2023
Written in
2022/2023

The Easy to Advanced Data Structure series is a complete guide to learning everything there is to know about data structures.. WE will learn how to code various data structures together with simple to follow step by step instructions for every data structure. We will be going over some working source code to solidify your understanding.. WE will also be posting various coding exercises and multiple-choice questions..

Show more Read less
Institution
Course

Content preview

Data structures introduction
The Easy to Advanced Data Structure series is a complete guide to learning everything there
is to know about data structures.. WE will learn how to code various data structures together
with simple to follow step by step instructions for every data structure. We will be going over
some working source code to solidify your understanding.. WE will also be posting various
coding exercises and multiple-choice questions..




Abstract data types
Data structures are essential ingredients in creating fast and powerful algorithms.. AN
Abstract Data type is an abstraction of a data structure which provides only the interface to
which that data structure must adhere to the interface. Does not give any specific details on
how a specific data structure should be implemented or in what programming language.
Data structures make code cleaner and easier to understand as a side note. THe abstract
data type only defines how a data structure should behave and what maths as it should have
but not the details surrounding how those methods are implemented. That is all for this
video. In the next video. We will be talking about computational complexity and Big O
notation. See you then.




Introduction to Big-O
If your program takes a lifetime of the universe to finish then it is no good if your program
runs in constant time but requires a space equal to the sum of all the bytes of all files on the
internet. Internet users have come up with algorithms that run in constant time, but they
would be useless if they took up as much space as all the files on the internet. Theoretical
computer scientists have invented big O notation which tells us about the worst case.
Almost any mathematical expression containing n can be wrapped around a big O and is big
O notation valid. Big O only really cares about what happens when input becomes really big
so we're not interested when and as small only what happens to n go to infinity so this is
how and why we get the first two properties. The rule we use to determine the complexity of
this algorithm is to multiply loops on different levels and add those that are on the same

,generally speaking so using the rule above we can see that it takes n work to do the outer
loop multiplied by 3 n plus 2 n for both inner loops which gives us 5m squared which is big o
of n squared. If your algorithm takes a space smaller than the sum of all the bytes of all files
on the internet, it is still useful. This algorithm is efficient because it only needs to do its
work once, not repeatedly like other algorithms.

In the outer loop, it goes from 0 to 3. So, 3n work is done on the outside. However, in the
inside loop, j goes from 10 to 50. This means that 40 loops are done every loop. This is a
constant amount of work, no matter what I go through.




Dynamic and Static Arrays
The most common use of arrays is to temporarily store objects. they are used as lookup
tables because of their indexing property.. They can also be used to store objects and
lookups tables in programming languages that only allow one return value. We will go over
some complexity analysis and look at some source code on how to construct a dynamic
array using only static arrays. The access time for a static array and a dynamic array is
constant because of the property that arrays are indexable. So searching however, it can take
up to linear time because we potentially have to traverse all the elements in the array. In the
worst case, such as if the element you're looking for just does not exist. dynamic arrays can
grow and shrink in size as needed, so the dynamic array can do all the similar get set
operation static erase. can do, but unlike the static array, it grows inside as dynamically as
needed. you to explicitly reference the indices of your array. Although the indexing is done
internally behind the scenes. The notation of the square brackets denotes indexing..

The link below the video should also be provided in the description so guys thanks for
watching and hopefully I will catch you in the next video.. the link below is the link between
the video and the video you can watch from the end of the video below. The video is a live
webcast from Ireport. com..



Dynamic Array Code
This is part 2 of 2 in the Arrays series So The source code for this video can be found at the
following link. Github. com slash my years a name slash data structures also make sure you

, saw the last video, so you know what 's going on with this array implementation. a dynamic
array is just a dynamic array. If you look at jervis a realist. It looks very very similar to this so
guys thanks for watching and I will catch you in the next video. I decided to do the following
maintain two indices I and J increment I and. J as you go but when i go to the remove index,
then we skip over the index by fixing J temporarily and using j to lag behind if you will a while
is still in the original array..




Linked Lists Introduction
There are two types of linked lists - singly linked lists and doubly linked lists. In a singly
linked list, each element has a pointer to the next element in the list, and a pointer to the
previous element. In a doubly linked list, each element also has a pointer to the next node
and a pointer to the previous node. This is useful sometimes, but not always. A doubly linked
list also has pointers for the next node and the previous node, but we have to change them in
the insertion phase. The trick we're going to use is not to use one pointer, but to use one
pointer for visual effects and use two pointers for actual implementation. We create
pointers, travel one and trav 24 traverser ones.

Searching a linked list is linear in the worst case because if the element we are looking for is
not there, we have to traverse all of the n elements entering it ahead so it is constant time.
For the tail to remove the head of a linked list, we can remove it but only once because we
can't reset the value of what the tail is so we have to seek to the end of the list and find out
what the new tail is. The code for the WA Qwest in the next video has a look at the code repo
provided below. It contains all the data structures I will be covering in this series of videos. I
will see you in the second video of this series on Monday night at 8pm.



Doubly Linked List Code
In the linked list series, part 2 will talk about how to use slash data structures, specifically a
doubly linked list. We will be keeping track of the size of the list as well as what the head and
the tail currently are. We will be able to traverse through the linked list until we find a null
element and then remove that node and return true. We will use the dot equals method to
check if we found the element we want to remove. We will use the index of before our

Written for

Course

Document information

Uploaded on
March 3, 2023
Number of pages
24
Written in
2022/2023
Type
SUMMARY

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
prathameshmokal

Get to know the seller

Seller avatar
prathameshmokal PUV
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions