SlideShare a Scribd company logo
1 of 11
Download to read offline
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 accessing using for loops
Arrays accessing using for loopsArrays accessing using for loops
Arrays accessing using for loopssangrampatil81
 
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.pptxsangeeta borde
 
data structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptxdata structure unit -1_170434dd7400.pptx
data structure unit -1_170434dd7400.pptxcoc7987515756
 
Data structures and algorithms arrays
Data structures and algorithms   arraysData structures and algorithms   arrays
Data structures and algorithms arrayschauhankapil
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxsarala9
 
8074.pdf
8074.pdf8074.pdf
8074.pdfBAna36
 
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 structureRai 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 structureRai University
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptxSajalFayyaz
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfAxmedcarb
 

Similar to 12000121037.pdf (20)

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
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 

Recently uploaded

2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group MeetingAlison Pitt
 
edited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfedited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfgreat91
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证ppy8zfkfm
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token PredictionNABLAS株式会社
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunksgmuir1066
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...ThinkInnovation
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesBoston Institute of Analytics
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxStephen266013
 
Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksSensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksBoston Institute of Analytics
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Valters Lauzums
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证acoha1
 
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...BabaJohn3
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Klinik Aborsi
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理pyhepag
 
社内勉強会資料  Mamba - A new era or ephemeral
社内勉強会資料   Mamba - A new era or ephemeral社内勉強会資料   Mamba - A new era or ephemeral
社内勉強会資料  Mamba - A new era or ephemeralNABLAS株式会社
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024patrickdtherriault
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理pyhepag
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证pwgnohujw
 
The Significance of Transliteration Enhancing
The Significance of Transliteration EnhancingThe Significance of Transliteration Enhancing
The Significance of Transliteration Enhancingmohamed Elzalabany
 

Recently uploaded (20)

2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting
 
edited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfedited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdf
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
 
社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction社内勉強会資料_Object Recognition as Next Token Prediction
社内勉強会資料_Object Recognition as Next Token Prediction
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
 
Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksSensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
 
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
Jual Obat Aborsi Bandung (Asli No.1) Wa 082134680322 Klinik Obat Penggugur Ka...
 
一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理一比一原版西悉尼大学毕业证成绩单如何办理
一比一原版西悉尼大学毕业证成绩单如何办理
 
社内勉強会資料  Mamba - A new era or ephemeral
社内勉強会資料   Mamba - A new era or ephemeral社内勉強会資料   Mamba - A new era or ephemeral
社内勉強会資料  Mamba - A new era or ephemeral
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
 
The Significance of Transliteration Enhancing
The Significance of Transliteration EnhancingThe Significance of Transliteration Enhancing
The Significance of Transliteration Enhancing
 

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/