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
Class notes

Summary Notes of DSA lecture 1

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

Lecture notes of 2 pages for the course Data structures and algorithms at Data structures and algorithms (Summary)

Institution
Course

Content preview

Arrays in Data Structure | Declaration,
Initialization, Memory representation
At runtime, arrays can be initialized using loops and predefined functions
such as scanner. In the upcoming video, the methods for taking data from
a user and storing it in an array will be discussed, followed by topics on
inserting data and traversing arrays, including types of operations on a 1D
array and time taken for each operation. The video will also cover the
concept of a 2D array and how it can be accessed. Faerie explains the
need and concept of arrays in detail, highlighting how arrays can be
declared, initialized, and represented in memory. An array is a storage
space for multiple values, and while a variable can only store one value,
an array can store multiple values at once. For example, to store data for
60 students, one would need to take the approach of an array, rather than
creating 60 individual variables. In order to create an array, one must
declare the data type, array name, and size. The size must be a constant
and specific to the language being used. The syntax for array declaration
may differ depending on the programming language, but the concept
remains the same. Additionally, the memory representation of an array
and how data is stored in memory will be covered in the upcoming videos.
Furthermore, the upcoming video will focus on 1D arrays, with an example
array named variable B with a set size. The methods for accessing and
using variable B will be discussed, including the process of representing it
in memory.

Data is to be represented in memory or the memory representation of an
array. The need for ferry and how to deal with it is explained. The concept
of an array was introduced because of the large amount of data that
needed to be processed. The declaration syntax for arrays may vary
depending on the programming language being used. All elements in an
array are stored in consecutive or continuous locations one after another
in memory. The elements are stored in successive locations, and the
index starts from zero. The size of the array cannot be changed at
runtime, and at compile time, you specify what elements you want in the
array. During runtime, you can only store a fixed amount of elements. In
the case of a 5 by 4 array, which is a fixed-size array, 20 bytes are
allocated depending on the memory manager used. The memory manager
allocates consecutive bytes in successive locations for storing the
elements of the array. Dynamic arrays and other programming languages'
syntax for array declaration are discussed in later sections. The 6 in the
array is first converted to binary form and then stored in four bytes. To
calculate the address for the location, the formula is base address plus the
I value into the size of the array, which is a data type of 4 bytes. The
drawback of arrays is the wastage of space. The array follows the random
access method, meaning you can access any data with constant time if
you know the base address.

Written for

Course

Document information

Uploaded on
March 18, 2023
Number of pages
2
Written in
2022/2023
Type
Class notes
Professor(s)
Jenny\'s lectures cs it
Contains
1

Subjects

$8.69
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
thecarguy177

Get to know the seller

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

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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