SlideShare a Scribd company logo
1 of 14
1
ArrayList in C#
Collections
Collection classes are specialized classes for data storage and retrieval. These classes
provide support for stacks, queues, lists, and hash tables. Most collection classes
implement the same interfaces.
Collection classes serve various purposes, such as allocating memory dynamically to
elements and accessing a list of items on the basis of an index etc. These classes create
collections of objects of the Object class, which is the base class for all data types in C#.
Various Collection Classes and Their Usage
The following are the some commonly used classes of the System.Collection
namespace.
Collections
Class Description and Usage
ArrayList
It represents ordered collection of an object that can be indexed individually.
It is basically an alternative to an array. However, unlike array you can add and remove items
from a list at a specified position using an index and the array resizes itself automatically. It
also allows dynamic memory allocation, adding, searching and sorting items in the list.
Hashtable
It uses a key to access the elements in the collection.
A hash table is used when you need to access elements by using key, and you can identify a
useful key value. Each item in the hash table has a key/value pair. The key is used to access
the items in the collection.
SortedList
It uses a key as well as an index to access the items in a list.
A sorted list is a combination of an array and a hash table. It contains a list of items that can
be accessed using a key or an index. If you access items using an index, it is an ArrayList, and
if you access items using a key , it is a Hashtable.
The collection of items is always sorted by the key value.
Stack
It represents a last-in, first out collection of object.
It is used when you need a last-in, first-out access of items. When you add an item in the list,
it is called pushing the item and when you remove it, it is called popping the item.
Queue
It represents a first-in, first out collection of object.
It is used when you need a first-in, first-out access of items. When you add an item in the
list, it is called enqueue and when you remove an item, it is called deque.
BitArray
It represents an array of the binary representation using the values 1 and 0.
It is used when you need to store the bits but do not know the number of bits in advance. You
can access items from the BitArray collection by using an integer index, which starts from
zero.
ArrayList
๏ต The ArrayList collection class is a conventional arrays and
provides dynamic resizing of the collection.
Method / Property Description
Add Adds an object to the end of the ArrayList.
Capacity Property that gets and sets the number of elements for which space
is currently reserved in the ArrayList.
Clear Removes all elements from the ArrayList.
Contains Determines whether an element is in the ArrayList.
Count Read-only property that gets the number of elements stored in the
ArrayList.
IndexOf Returns the zero-based index of the first occurrence of a value in the
ArrayList
Insert Inserts an element into the ArrayList at the specified index.
Remove Removes the first occurrence of a specific object from the ArrayList.
RemoveAt Removes the element at the specified index of the ArrayList.
TrimToSize Sets the capacity to the actual number of elements in the ArrayList.
Methods of the ArrayList class:
Sr. No. Methods
1 public virtual int Add( object value );
Adds an object to the end of the ArrayList.
2 public virtual void AddRange( ICollection c );
Adds the elements of an ICollection to the end of the ArrayList.
3 public virtual void Clear();
Removes all elements from the ArrayList.
4 public virtual bool Contains( object item );
Determines whether an element is in the ArrayList.
5 public virtual ArrayList GetRange( int index, int count );
Returns an ArrayList which represents a subset of the elements in the source
ArrayList.
6 public virtual int IndexOf(object);
Returns the zero-based index of the first occurrence of a value in the ArrayList or
in a portion of it.
7 public virtual void Insert( int index, object value );
Inserts an element into the ArrayList at the specified index.
Methods of the ArrayList class:
Sr. No. Methods
8 public virtual void InsertRange( int index, ICollection c );
Inserts the elements of a collection into the ArrayList at the specified index.
9 public virtual void Remove( object obj );
Removes the first occurrence of a specific object from the ArrayList.
10 public virtual void RemoveAt( int index );
Removes the element at the specified index of the ArrayList.
11 public virtual void RemoveRange( int index, int count );
Removes a range of elements from the ArrayList.
12 public virtual void Reverse();
Reverses the order of the elements in the ArrayList.
13 public virtual void SetRange( int index, ICollection c );
Copies the elements of a collection over a range of elements in the ArrayList.
14 public virtual void Sort();
Sorts the elements in the ArrayList.
Example
The following example demonstrates the concept:
You have been requested to develop an application which maintain set of items and prices
during run time:
Sharaf DG needs a program to store Items and its Prices. They want to have the options to
sort by itemsโ€™ name as well to sort prices.
Design an interface similar to the following
Example : Interface Design
Tools names are labeled as shown in below figure.
txtItem txtPrice
btnAdd
btnDP
btnON
btnAPbtnOP
btnAN
Example : Coding
Validate entered price: is double
Add Names & Prices to the ArrayLits
Convert to double data typeConvert to double data type
Use collection library
Example : Coding
Validate entered price: is double
Add Names & Prices to the ArrayLits
Convert to double data typeConvert to double data type
Example : Coding
Displays items names
1. The original list of names
2. The ascending sorted names
3. The descending sorted names
Example : Coding
Displays items Prices
1. The original list of Prices
2. The ascending sorted Prices
3. The descending sorted Prices
Example : Runtime
Enter these values with the same sequence
TV 1500
Flash disk 120
Camera 680
Mobile 550
Apple Laptop 2200
Example : Runtime
Enter these values with the same sequence
TV 1500
Flash disk 120
Camera 680
Mobile 550
Apple Laptop 2200

More Related Content

What's hot

Java Collections
Java CollectionsJava Collections
Java Collections
parag
ย 
Collections In Java
Collections In JavaCollections In Java
Collections In Java
Binoj T E
ย 
Java collections
Java collectionsJava collections
Java collections
Amar Kutwal
ย 
Chapter 12
Chapter 12Chapter 12
Chapter 12
Graham Royce
ย 

What's hot (20)

5 collection framework
5 collection framework5 collection framework
5 collection framework
ย 
F sharp lists & dictionary
F sharp   lists &  dictionaryF sharp   lists &  dictionary
F sharp lists & dictionary
ย 
Java Collections
Java CollectionsJava Collections
Java Collections
ย 
JAVA Collections frame work ppt
 JAVA Collections frame work ppt JAVA Collections frame work ppt
JAVA Collections frame work ppt
ย 
Collections In Java
Collections In JavaCollections In Java
Collections In Java
ย 
Java collection
Java collectionJava collection
Java collection
ย 
Java10 Collections and Information
Java10 Collections and InformationJava10 Collections and Information
Java10 Collections and Information
ย 
Collections Api - Java
Collections Api - JavaCollections Api - Java
Collections Api - Java
ย 
Java.util
Java.utilJava.util
Java.util
ย 
Java ArrayList Tutorial | Edureka
Java ArrayList Tutorial | EdurekaJava ArrayList Tutorial | Edureka
Java ArrayList Tutorial | Edureka
ย 
java collections
java collectionsjava collections
java collections
ย 
Collections in Java
Collections in JavaCollections in Java
Collections in Java
ย 
Java - Collections framework
Java - Collections frameworkJava - Collections framework
Java - Collections framework
ย 
Java Collection framework
Java Collection frameworkJava Collection framework
Java Collection framework
ย 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
ย 
Collection Framework in java
Collection Framework in javaCollection Framework in java
Collection Framework in java
ย 
Java collections
Java collectionsJava collections
Java collections
ย 
Collections framework in java
Collections framework in javaCollections framework in java
Collections framework in java
ย 
Chapter 12
Chapter 12Chapter 12
Chapter 12
ย 
22.collections(1)
22.collections(1)22.collections(1)
22.collections(1)
ย 

Similar to Array list(1)

oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collection
ssuseredfbe9
ย 
Collection Framework-1.pptx
Collection Framework-1.pptxCollection Framework-1.pptx
Collection Framework-1.pptx
SarthakSrivastava70
ย 
COLLECTIONS.pptx
COLLECTIONS.pptxCOLLECTIONS.pptx
COLLECTIONS.pptx
SruthyPJ
ย 
Collections
CollectionsCollections
Collections
sagsharma
ย 
Generic Programming & Collection
Generic Programming & CollectionGeneric Programming & Collection
Generic Programming & Collection
Arya
ย 
Generic Programming & Collection
Generic Programming & CollectionGeneric Programming & Collection
Generic Programming & Collection
Arya
ย 
java I am trying to run my code but it is not letting me .pdf
java    I am trying to run my code but it is not letting me .pdfjava    I am trying to run my code but it is not letting me .pdf
java I am trying to run my code but it is not letting me .pdf
adinathassociates
ย 
Array properties
Array propertiesArray properties
Array properties
Shravan Sharma
ย 
Presentation1
Presentation1Presentation1
Presentation1
Anand Grewal
ย 

Similar to Array list(1) (20)

oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collection
ย 
javacollections.pdf
javacollections.pdfjavacollections.pdf
javacollections.pdf
ย 
Collection Framework-1.pptx
Collection Framework-1.pptxCollection Framework-1.pptx
Collection Framework-1.pptx
ย 
Generics collections
Generics collectionsGenerics collections
Generics collections
ย 
COLLECTIONS.pptx
COLLECTIONS.pptxCOLLECTIONS.pptx
COLLECTIONS.pptx
ย 
Collections
CollectionsCollections
Collections
ย 
Collections generic
Collections genericCollections generic
Collections generic
ย 
Java collections
Java collectionsJava collections
Java collections
ย 
Collections lecture 35 40
Collections lecture 35 40Collections lecture 35 40
Collections lecture 35 40
ย 
Collections and generics
Collections and genericsCollections and generics
Collections and generics
ย 
STRINGS IN JAVA
STRINGS IN JAVASTRINGS IN JAVA
STRINGS IN JAVA
ย 
A2003822018_21789_17_2018_09. ArrayList.ppt
A2003822018_21789_17_2018_09. ArrayList.pptA2003822018_21789_17_2018_09. ArrayList.ppt
A2003822018_21789_17_2018_09. ArrayList.ppt
ย 
ArrayList.docx
ArrayList.docxArrayList.docx
ArrayList.docx
ย 
01-intro_stacks.ppt
01-intro_stacks.ppt01-intro_stacks.ppt
01-intro_stacks.ppt
ย 
Generic Programming & Collection
Generic Programming & CollectionGeneric Programming & Collection
Generic Programming & Collection
ย 
Generic Programming & Collection
Generic Programming & CollectionGeneric Programming & Collection
Generic Programming & Collection
ย 
java I am trying to run my code but it is not letting me .pdf
java    I am trying to run my code but it is not letting me .pdfjava    I am trying to run my code but it is not letting me .pdf
java I am trying to run my code but it is not letting me .pdf
ย 
Array properties
Array propertiesArray properties
Array properties
ย 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshan
ย 
Presentation1
Presentation1Presentation1
Presentation1
ย 

More from abdullah619 (12)

Testing chapter updated (1)
Testing chapter updated (1)Testing chapter updated (1)
Testing chapter updated (1)
ย 
Queue
QueueQueue
Queue
ย 
Stacks
StacksStacks
Stacks
ย 
Lists
Lists Lists
Lists
ย 
Collections (1)
Collections (1)Collections (1)
Collections (1)
ย 
Exception handling
Exception handlingException handling
Exception handling
ย 
Polumorphism
PolumorphismPolumorphism
Polumorphism
ย 
Abstrcation
AbstrcationAbstrcation
Abstrcation
ย 
4 oo inheritance in c# (1)
4   oo inheritance in c# (1)4   oo inheritance in c# (1)
4 oo inheritance in c# (1)
ย 
3 instantiating an object in c# (1)
3  instantiating an object in c# (1)3  instantiating an object in c# (1)
3 instantiating an object in c# (1)
ย 
Methods in c# (1)
Methods in c# (1)Methods in c# (1)
Methods in c# (1)
ย 
5. linked list
5. linked list5. linked list
5. linked list
ย 

Recently uploaded

CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
anilsa9823
ย 

Recently uploaded (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
ย 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
ย 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female serviceCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Badshah Nagar Lucknow best Female service
ย 
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spacesย - and Epistemic Querying of RDF-...
ย 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
ย 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
ย 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
ย 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
ย 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
ย 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanโ€™s ...
ย 
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธCALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online  โ˜‚๏ธ
CALL ON โžฅ8923113531 ๐Ÿ”Call Girls Kakori Lucknow best sexual service Online โ˜‚๏ธ
ย 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
ย 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
ย 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
ย 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
ย 
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธcall girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
call girls in Vaishali (Ghaziabad) ๐Ÿ” >เผ’8448380779 ๐Ÿ” genuine Escort Service ๐Ÿ”โœ”๏ธโœ”๏ธ
ย 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
ย 
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS LiveVip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida โžก๏ธ Delhi โžก๏ธ 9999965857 No Advance 24HRS Live
ย 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
ย 

Array list(1)

  • 2. Collections Collection classes are specialized classes for data storage and retrieval. These classes provide support for stacks, queues, lists, and hash tables. Most collection classes implement the same interfaces. Collection classes serve various purposes, such as allocating memory dynamically to elements and accessing a list of items on the basis of an index etc. These classes create collections of objects of the Object class, which is the base class for all data types in C#. Various Collection Classes and Their Usage The following are the some commonly used classes of the System.Collection namespace.
  • 3. Collections Class Description and Usage ArrayList It represents ordered collection of an object that can be indexed individually. It is basically an alternative to an array. However, unlike array you can add and remove items from a list at a specified position using an index and the array resizes itself automatically. It also allows dynamic memory allocation, adding, searching and sorting items in the list. Hashtable It uses a key to access the elements in the collection. A hash table is used when you need to access elements by using key, and you can identify a useful key value. Each item in the hash table has a key/value pair. The key is used to access the items in the collection. SortedList It uses a key as well as an index to access the items in a list. A sorted list is a combination of an array and a hash table. It contains a list of items that can be accessed using a key or an index. If you access items using an index, it is an ArrayList, and if you access items using a key , it is a Hashtable. The collection of items is always sorted by the key value. Stack It represents a last-in, first out collection of object. It is used when you need a last-in, first-out access of items. When you add an item in the list, it is called pushing the item and when you remove it, it is called popping the item. Queue It represents a first-in, first out collection of object. It is used when you need a first-in, first-out access of items. When you add an item in the list, it is called enqueue and when you remove an item, it is called deque. BitArray It represents an array of the binary representation using the values 1 and 0. It is used when you need to store the bits but do not know the number of bits in advance. You can access items from the BitArray collection by using an integer index, which starts from zero.
  • 4. ArrayList ๏ต The ArrayList collection class is a conventional arrays and provides dynamic resizing of the collection. Method / Property Description Add Adds an object to the end of the ArrayList. Capacity Property that gets and sets the number of elements for which space is currently reserved in the ArrayList. Clear Removes all elements from the ArrayList. Contains Determines whether an element is in the ArrayList. Count Read-only property that gets the number of elements stored in the ArrayList. IndexOf Returns the zero-based index of the first occurrence of a value in the ArrayList Insert Inserts an element into the ArrayList at the specified index. Remove Removes the first occurrence of a specific object from the ArrayList. RemoveAt Removes the element at the specified index of the ArrayList. TrimToSize Sets the capacity to the actual number of elements in the ArrayList.
  • 5. Methods of the ArrayList class: Sr. No. Methods 1 public virtual int Add( object value ); Adds an object to the end of the ArrayList. 2 public virtual void AddRange( ICollection c ); Adds the elements of an ICollection to the end of the ArrayList. 3 public virtual void Clear(); Removes all elements from the ArrayList. 4 public virtual bool Contains( object item ); Determines whether an element is in the ArrayList. 5 public virtual ArrayList GetRange( int index, int count ); Returns an ArrayList which represents a subset of the elements in the source ArrayList. 6 public virtual int IndexOf(object); Returns the zero-based index of the first occurrence of a value in the ArrayList or in a portion of it. 7 public virtual void Insert( int index, object value ); Inserts an element into the ArrayList at the specified index.
  • 6. Methods of the ArrayList class: Sr. No. Methods 8 public virtual void InsertRange( int index, ICollection c ); Inserts the elements of a collection into the ArrayList at the specified index. 9 public virtual void Remove( object obj ); Removes the first occurrence of a specific object from the ArrayList. 10 public virtual void RemoveAt( int index ); Removes the element at the specified index of the ArrayList. 11 public virtual void RemoveRange( int index, int count ); Removes a range of elements from the ArrayList. 12 public virtual void Reverse(); Reverses the order of the elements in the ArrayList. 13 public virtual void SetRange( int index, ICollection c ); Copies the elements of a collection over a range of elements in the ArrayList. 14 public virtual void Sort(); Sorts the elements in the ArrayList.
  • 7. Example The following example demonstrates the concept: You have been requested to develop an application which maintain set of items and prices during run time: Sharaf DG needs a program to store Items and its Prices. They want to have the options to sort by itemsโ€™ name as well to sort prices. Design an interface similar to the following
  • 8. Example : Interface Design Tools names are labeled as shown in below figure. txtItem txtPrice btnAdd btnDP btnON btnAPbtnOP btnAN
  • 9. Example : Coding Validate entered price: is double Add Names & Prices to the ArrayLits Convert to double data typeConvert to double data type Use collection library
  • 10. Example : Coding Validate entered price: is double Add Names & Prices to the ArrayLits Convert to double data typeConvert to double data type
  • 11. Example : Coding Displays items names 1. The original list of names 2. The ascending sorted names 3. The descending sorted names
  • 12. Example : Coding Displays items Prices 1. The original list of Prices 2. The ascending sorted Prices 3. The descending sorted Prices
  • 13. Example : Runtime Enter these values with the same sequence TV 1500 Flash disk 120 Camera 680 Mobile 550 Apple Laptop 2200
  • 14. Example : Runtime Enter these values with the same sequence TV 1500 Flash disk 120 Camera 680 Mobile 550 Apple Laptop 2200

Editor's Notes

  1. Collections are data structures that holds data in different ways for flexible operations.