AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Collections Presented By : Muhammad Atif Hussain Deputy Manager IT (Takaful.

Slides:



Advertisements
Similar presentations
Lists and the Collection Interface Chapter 4. Chapter Objectives To become familiar with the List interface To understand how to write an array-based.
Advertisements

Data Structures A data structure is a collection of data organized in some fashion that permits access to individual elements stored in the structure This.
1 Generic Collections Chapter Objectives You will be able to Use generic collection classes available in the.NET framework.
1 Chapter 24 Lists Stacks and Queues. 2 Objectives F To design list with interface and abstract class (§24.2). F To design and implement a dynamic list.
CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
Chapter 12: Data Structures
CS 106 Introduction to Computer Science I 12 / 11 / 2006 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 10 / 26 / 2009 Instructor: Michael Eckmann.
24-Jun-15 Introduction to Collections. 2 Collections A collection is a structured group of objects Java 1.2 introduced the Collections Framework Collections.
1 Data Structures  We can now explore some advanced techniques for organizing and managing information  Chapter 12 of the book focuses on: dynamic structures.
Chapter 12 C Data Structures Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
COMP 110 Introduction to Programming Mr. Joshua Stough.
Summary of lectures (1 to 11)
C# Programming: From Problem Analysis to Program Design1 Advanced Collections C# Programming: From Problem Analysis to Program Design 3 rd Edition 8.
Liang, Introduction to Java Programming, Tenth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 20 Lists, Stacks, Queues, and Priority.
CS 106 Introduction to Computer Science I 12 / 13 / 2006 Instructor: Michael Eckmann.
1 Stack Data : a collection of homogeneous elements arranged in a sequence. Only the first element may be accessed Main Operations: Push : insert an element.
© 2004 Pearson Addison-Wesley. All rights reserved12-1 Chapter 12 : Collections Intermediate Java Programming Summer 2007.
Lists, Stacks, Queues Svetlin Nakov Telerik Corporation
Java Collections Framework A presentation by Eric Fabricant.
Chapter 12 Data Structure Associate Prof. Yuh-Shyan Chen Dept. of Computer Science and Information Engineering National Chung-Cheng University.
Chapter 3 List Stacks and Queues. Data Structures Data structure is a representation of data and the operations allowed on that data. Data structure is.
Data Structures and Abstract Data Types "Get your data structures correct first, and the rest of the program will write itself." - David Jones.
Jan 12, 2012 Introduction to Collections. 2 Collections A collection is a structured group of objects Java 1.2 introduced the Collections Framework Collections.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Chapter 9 (modified) Abstract Data Types and Algorithms Nell Dale John Lewis.
1/ 124 COP 3503 FALL 2012 SHAYAN JAVED LECTURE 18 Programming Fundamentals using Java 1.
1 Chapter 7 Stacks and Queues. 2 Stack ADT Recall that ADT is abstract data type, a set of data and a set of operations that act upon the data. In a stack,
Data Structures (part 2). Stacks An Everyday Example Your boss keeps bringing you important items to deal with and keeps saying: “Put that last ‘rush’
Data structures Abstract data types Java classes for Data structures and ADTs.
CSS446 Spring 2014 Nan Wang  Java Collection Framework ◦ LinkedList ◦ Set ◦ Map 2.
HIT2037- HIT6037 Software Development in Java 22 – Data Structures and Introduction.
Data structures and algorithms in the collection framework 1.
ELC 310 Day 24. © 2004 Pearson Addison-Wesley. All rights reserved12-2 Agenda Questions? Problem set 5 Parts A & B Corrected  Good results  2 A’s, 1.
Holding Your Objects Generics and type-safe containers One of the problems of using pre-Java SE5 containers was that the compiler allowed.
A data structure is a type of data storage ….similar to an array. There are many data structures in Java (Stacks, Queues, LinkedList, Sets, Maps, HashTables,
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company.NET Assemblies Presented By : Muhammad Atif Hussain Deputy Manager IT.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company ASP.NET Validation Control Presented By : Muhammad Atif Hussain Deputy.
COP INTERMEDIATE JAVA Data Structures. A data structure is a way of organizing a collection of data so that it can be manipulated effectively. A.
CIS3023: Programming Fundamentals for CIS Majors II Summer 2010 Ganesh Viswanathan Generics and Collections Course Lecture Slides 19 th July 2010 “Never.
Data Structures: Advanced Damian Gordon. Advanced Data Structure We’ll look at: – Linked Lists – Trees – Stacks – Queues.
Understanding Data Types and Collections Lesson 2.
Chapter 12: Collections by Lewis and Loftus (Updated by Dan Fleck) Coming up: Collections.
Foundation of Computing Systems Lecture 3 Stacks and Queues.
1 Linked-list, stack and queue. 2 Outline Abstract Data Type (ADT)‏ Linked list Stack Queue.
Arrays and Collections Tonga Institute of Higher Education.
Data Structures academy.zariba.com 1. Lecture Content 1.Linear Data Structures 2.Trees and Graphs* 3.Dictionaries and Hash Tables 4.Homework 2.
Interface: (e.g. IDictionary) Specification class Appl{ ---- IDictionary dic; dic= new XXX(); application class: Dictionary SortedDictionary ----
Collections Data structures in Java. OBJECTIVE “ WHEN TO USE WHICH DATA STRUCTURE ” D e b u g.
Data Structures Chapter 6. Data Structure A data structure is a representation of data and the operations allowed on that data. Examples: 1.Array 2.Record.
Session 07 Module 13 - Collections. Collections / Session 7 / 2 of 32 Review  A delegate in C# is used to refer to a method in a safe manner.  To invoke.
Data-structure-palooza Checkout DataStructures from SVN.
C++ Review STL CONTAINERS.
Data Structures David Kauchak cs302 Spring Data Structures What is a data structure? Way of storing data that facilitates particular operations.
1 Principles revisited.NET: Two libraries: System.Collections System.Collections.Generics Data Structures and Collections.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Web Tools Presented By : Qazi Muhammad Arfeen Senior Software Engineer.
Queues 1. Introduction A sequential collection of data Changes occur at both ends, not just one Queue applications –files waiting to be printed –"jobs"
Chapter  Array-like data structures  ArrayList  Queue  Stack  Hashtable  SortedList  Offer programming convenience for specific access.
Understanding Data Types and Collections Lesson 2.
G64ADS Advanced Data Structures
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
Chapter 12 – Data Structures
C# Programming: From Problem Analysis to Program Design
Stacks and Queues.
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
structures and their relationships." - Linus Torvalds
structures and their relationships." - Linus Torvalds
structures and their relationships." - Linus Torvalds
Presentation transcript:

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Collections Presented By : Muhammad Atif Hussain Deputy Manager IT (Takaful Pakistan Limited) Technologies Consultant (AUC Technologies) MCS(KU) MSCS(SZABIST) MCP MCAD MCSD MCTS (Windows, Web, Distributed Applications) MCPD (Enterprise Applications) MCT(Microsoft Certified Trainer)

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Data Structure Types of Data structure Examples Agenda

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Collection of Objects Memory Representation of Data Data Structure

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Array ArrayList List<> LinkedList<> Dictionary HashTable HashSet Stack Queue Type of Data Structure (System.Collections)

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Array Most common and simplest List of Objects All the Objects are of same types Specified number of Objects [object type][] myArray = new [object type][number of elements] Examples int[] myIntArray = new int[5]; int[] myIntArray2 = { 0, 1, 2, 3, 4 };

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company ArrayList Dynamic Array Any type of Objects Any amount of Objects Expanded as more item are added Casting required when value retrieved Examples: ArrayList myArrayList = new ArrayList(); myArrayList.Add(56); myArrayList.Add("String"); int arrayListValue = (int)myArrayList[0];

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Typed ArrayList Dynamic Array Same type of Objects Examples: List intList = new List (); intList.Add(45); intList.Add(34); int listValue = intList[0]; Hint: For primative data types (int, bool, etc.) using a List is much faster than ArrayList List<>

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Series of Objects linked together in Nodes – Object Value – Next Node – Previous Node Adding values in the middle of the list is extremely fast Memory cost down to minimum Retrieving a value is not a straight forward Examples: LinkedList list = newLinkedList (); list.AddLast(6); LinkedList<>

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Programmer can handle index at their own Keys is also an Object Retrieving a value is pretty straight forward Examples: Dictionary myDictionary = new Dictionary (); myDictionary.Add("one", 1); myDictionary.Add("twenty", 20); int myInt = myDictionary["one"]; Dictionary<>

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Similar to Dictionary Data Structure Also takes in Key/Value pair but generic Objects opposed to typed data Values are stored in order of HashCode (Key) but Dictionary does keep items in the same order HashTable stores items faster than a Dictionary Examples: Hashtable myTable = new Hashtable(); myTable.Add("name", "Vb.NET"); myTable.Add(1, "C#.NET"); HashTable

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Introduced in.NET Framework 3.5 Resemble to List<> Data structure Its does not allow duplicate value Examples: HashSet mySet = new HashSet (); mySet.Add(3); mySet.Add(5); List myListFromSet = mySet.ToList (); int myInt = myListFromSet[1]; HashSet

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Resemble to ArrayList Push (Add), Pop (Get), LIFO Stack works with Objects, Stack<> works with specified Object Examples: Stack stack = new Stack(); stack.Push("1"); stack.Push("2"); stack.Push("3"); while (stack.Count > 0){MessageBox.Show(stack.Pop());} Stack and Stack<>

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Very similar to Stack Enqueue (Add), Dequeue (Remove) Queues goes by FIFO Examples: Queue queue = new Queue (); queue.Enqueue("1"); queue.Enqueue("2"); queue.Enqueue("3"); while (queue.Count > 0){MessageBox.Show(queue.Dequeue());} Queue

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company

AUC Technologies Projects Consulting, Development, Mentoring, and Training Company Questions ?