SlideShare a Scribd company logo
Dr. B.C. Roy Engineering College, Durgapur
Department of Computer Science and Engineering
Continuous Assessment 1
Topic: Array
Name: Rajdip Chatterjee
University Roll No: 12000121037
Section: CSE 1
Course Name: Data Structure & Algorithm
Course Code: PCC CS 301
Index
● Definition
● Algorithm
● Types
● Real life example of Array
● Advantages
● Disadvantages
● Conclusion
● Reference
Array Definition
● Arrays are the simplest data structures that store items of the same data
type.
● This makes it easier to calculate the position of each element by simply
adding an offset to a base value, i.e., the memory location of the first
element of the array (generally denoted by the name of the array).
● A basic application of Arrays can be storing data in tabular format.
● For example, if we wish to store the contacts on our phone, then the
software will simply place all our contacts in an array.
● Since the elements in the array are stored at contiguous memory
locations it is easy to iterate in this data structure and unit time is
required to access an element if the index is known.
Algorithm For Insertion In An Array
Array Reg[N] with last element at Mith
position value X is to be inserted at ith
location.
Steps:
• 1. If(M<N) then BACK=M+1 else STOP
• 2. While (BACK>i) repeat steps 3 to 4
• 3. REG[BACK]= REG[BACK-1]
• 4. BACK=BACK-1;
• 5. Reg[BACK]='X'
• 6. M=M+1
• 7. End.
Algorithm For Deletion In An Array
Algorithm: In this algorithm a value is being
deleted from ith location of an array Reg[N].
Let us assume that last element in the array
is at Mith position.
Steps
1. Back=1
2. While (Back<M) repeat 3 and 4
3. Reg[Back]= Reg[Back+1]
4. Back= Back+1
5. M=M-1
6. End
Types of Array
Indexed Array: Indexed arrays store a series of one or more values. You can look up items by their
position in the array, which you might have done in earlier sections. The first index is always the number 0, and the
index increments by one for each subsequent element that you add to the array.
Multidimensional Array: In ActionScript, you can implement arrays as nested arrays that are
essentially arrays of arrays. Nested arrays, also known as multidimensional arrays, are very similar to matrices or
grids. When you’re programming, you might use multidimensional arrays to model these kinds of structures.
Associative Array:An associative array, which is like an object, is made of unordered keys and
values. Associative arrays use keys instead of a numeric index to organize stored values. Each key is a unique string,
and it’s associated with and used to access one value.
Real life example of Array
Let’s see some real-world arrays:
● Arranging books: You have a pile of books and a rack
with multiple layers. Once all the books are arranged, you
essentially created an array of elements (in this case,
books)
● A Mango plantation: Can be defined as the nested array.
Imagine 10 trees in each row and 10 such rows. You can
also call this a matrix ( or a list of list perhaps? )
● Bullet points mentioned here: All the points described
here is in an ordered series, so essentially, we create an
array (of 3 elements)
Advantages of array data structure
● Arrays store multiple data of similar types with the same name.
● It allows random access to elements.
● As the array is of fixed size and stored in contiguous memory
locations there is no memory shortage or overflow.
● It is helpful to store any type of data with a fixed size.
● Since the elements in the array are stored at contiguous memory
locations it is easy to iterate in this data structure and unit time is
required to access an element if the index is known.
Disadvantages of array data structure
● The size of the array should be known in advance.
● The array is a static data structure with a fixed size so, the
size of the array cannot be modified further and hence no
modification can be done during runtime.
● Insertion and deletion operations are costly in arrays as
elements are stored in contiguous memory.
● If the size of the declared array is more than the required
size then, it can lead to memory wastage.
Conclusion
Arrays are more efficient and beneficial when
compared to linked lists and hash tables. They are
faster and can be utilized anywhere. They store data
of similar data types together and can be used
anywhere in the code.
Reference
● https://www.geeksforgeeks.org/
● https://www.cs.fsu.edu/
● https://www.quora.com/What-are-the-real-life-applications-of-array
● https://www.educba.com/advantages-of-array/

More Related Content

Similar to 12000121037.pdf

Arrays declartion and initialization
Arrays declartion and initializationArrays declartion and initialization
Arrays declartion and initialization
sangrampatil81
 
Arrays in C
Arrays in CArrays in C
Arrays in C
sangrampatil81
 
Cunit3.pdf
Cunit3.pdfCunit3.pdf
Cunit3.pdf
zeenatparveen24
 
Arrays
ArraysArrays
Arrays
ViniVini48
 
Arrays accessing using for loops
Arrays accessing using for loopsArrays accessing using for loops
Arrays accessing using for loops
sangrampatil81
 
UNIT-5_Array in c_part1.pptx
UNIT-5_Array in c_part1.pptxUNIT-5_Array in c_part1.pptx
UNIT-5_Array in c_part1.pptx
sangeeta borde
 
data structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptxdata structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptx
coc7987515756
 
java.pdf
java.pdfjava.pdf
java.pdf
RAJCHATTERJEE24
 
M v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notesM v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notes
Malikireddy Bramhananda Reddy
 
DEMO.ppt
DEMO.pptDEMO.ppt
Data structures and algorithms arrays
Data structures and algorithms   arraysData structures and algorithms   arrays
Data structures and algorithms arrays
chauhankapil
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
JohnStuart83
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
sarala9
 
8074.pdf
8074.pdf8074.pdf
8074.pdf
BAna36
 
Array
ArrayArray
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
MamataAnilgod
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
Rai University
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
Rai University
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
Prof. Dr. K. Adisesha
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptx
SajalFayyaz
 

Similar to 12000121037.pdf (20)

Arrays declartion and initialization
Arrays declartion and initializationArrays declartion and initialization
Arrays declartion and initialization
 
Arrays in C
Arrays in CArrays in C
Arrays in C
 
Cunit3.pdf
Cunit3.pdfCunit3.pdf
Cunit3.pdf
 
Arrays
ArraysArrays
Arrays
 
Arrays accessing using for loops
Arrays accessing using for loopsArrays accessing using for loops
Arrays accessing using for loops
 
UNIT-5_Array in c_part1.pptx
UNIT-5_Array in c_part1.pptxUNIT-5_Array in c_part1.pptx
UNIT-5_Array in c_part1.pptx
 
data structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptxdata structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptx
 
java.pdf
java.pdfjava.pdf
java.pdf
 
M v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notesM v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notes
 
DEMO.ppt
DEMO.pptDEMO.ppt
DEMO.ppt
 
Data structures and algorithms arrays
Data structures and algorithms   arraysData structures and algorithms   arrays
Data structures and algorithms arrays
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
8074.pdf
8074.pdf8074.pdf
8074.pdf
 
Array
ArrayArray
Array
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptx
 

Recently uploaded

End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
VyNguyen709676
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
wyddcwye1
 
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
bmucuha
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
bmucuha
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
ElizabethGarrettChri
 
Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024
facilitymanager11
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Kaxil Naik
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
exukyp
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
slg6lamcq
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 

Recently uploaded (20)

End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
writing report business partner b1+ .pdf
writing report business partner b1+ .pdfwriting report business partner b1+ .pdf
writing report business partner b1+ .pdf
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
 
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
一比一原版(CU毕业证)卡尔顿大学毕业证如何办理
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
 
Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024Monthly Management report for the Month of May 2024
Monthly Management report for the Month of May 2024
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
Orchestrating the Future: Navigating Today's Data Workflow Challenges with Ai...
 
UofT毕业证如何办理
UofT毕业证如何办理UofT毕业证如何办理
UofT毕业证如何办理
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 

12000121037.pdf

  • 1. Dr. B.C. Roy Engineering College, Durgapur Department of Computer Science and Engineering Continuous Assessment 1 Topic: Array Name: Rajdip Chatterjee University Roll No: 12000121037 Section: CSE 1 Course Name: Data Structure & Algorithm Course Code: PCC CS 301
  • 2. Index ● Definition ● Algorithm ● Types ● Real life example of Array ● Advantages ● Disadvantages ● Conclusion ● Reference
  • 3. Array Definition ● Arrays are the simplest data structures that store items of the same data type. ● This makes it easier to calculate the position of each element by simply adding an offset to a base value, i.e., the memory location of the first element of the array (generally denoted by the name of the array). ● A basic application of Arrays can be storing data in tabular format. ● For example, if we wish to store the contacts on our phone, then the software will simply place all our contacts in an array. ● Since the elements in the array are stored at contiguous memory locations it is easy to iterate in this data structure and unit time is required to access an element if the index is known.
  • 4. Algorithm For Insertion In An Array Array Reg[N] with last element at Mith position value X is to be inserted at ith location. Steps: • 1. If(M<N) then BACK=M+1 else STOP • 2. While (BACK>i) repeat steps 3 to 4 • 3. REG[BACK]= REG[BACK-1] • 4. BACK=BACK-1; • 5. Reg[BACK]='X' • 6. M=M+1 • 7. End.
  • 5. Algorithm For Deletion In An Array Algorithm: In this algorithm a value is being deleted from ith location of an array Reg[N]. Let us assume that last element in the array is at Mith position. Steps 1. Back=1 2. While (Back<M) repeat 3 and 4 3. Reg[Back]= Reg[Back+1] 4. Back= Back+1 5. M=M-1 6. End
  • 6. Types of Array Indexed Array: Indexed arrays store a series of one or more values. You can look up items by their position in the array, which you might have done in earlier sections. The first index is always the number 0, and the index increments by one for each subsequent element that you add to the array. Multidimensional Array: In ActionScript, you can implement arrays as nested arrays that are essentially arrays of arrays. Nested arrays, also known as multidimensional arrays, are very similar to matrices or grids. When you’re programming, you might use multidimensional arrays to model these kinds of structures. Associative Array:An associative array, which is like an object, is made of unordered keys and values. Associative arrays use keys instead of a numeric index to organize stored values. Each key is a unique string, and it’s associated with and used to access one value.
  • 7. Real life example of Array Let’s see some real-world arrays: ● Arranging books: You have a pile of books and a rack with multiple layers. Once all the books are arranged, you essentially created an array of elements (in this case, books) ● A Mango plantation: Can be defined as the nested array. Imagine 10 trees in each row and 10 such rows. You can also call this a matrix ( or a list of list perhaps? ) ● Bullet points mentioned here: All the points described here is in an ordered series, so essentially, we create an array (of 3 elements)
  • 8. Advantages of array data structure ● Arrays store multiple data of similar types with the same name. ● It allows random access to elements. ● As the array is of fixed size and stored in contiguous memory locations there is no memory shortage or overflow. ● It is helpful to store any type of data with a fixed size. ● Since the elements in the array are stored at contiguous memory locations it is easy to iterate in this data structure and unit time is required to access an element if the index is known.
  • 9. Disadvantages of array data structure ● The size of the array should be known in advance. ● The array is a static data structure with a fixed size so, the size of the array cannot be modified further and hence no modification can be done during runtime. ● Insertion and deletion operations are costly in arrays as elements are stored in contiguous memory. ● If the size of the declared array is more than the required size then, it can lead to memory wastage.
  • 10. Conclusion Arrays are more efficient and beneficial when compared to linked lists and hash tables. They are faster and can be utilized anywhere. They store data of similar data types together and can be used anywhere in the code.
  • 11. Reference ● https://www.geeksforgeeks.org/ ● https://www.cs.fsu.edu/ ● https://www.quora.com/What-are-the-real-life-applications-of-array ● https://www.educba.com/advantages-of-array/