1 / 11

CIS 3260

CIS 3260. Week 7 (Data Structures). Terms to Know. FIFO LIFO Generics Hashtable Dictionary<T>. Linked list ArrayList (and List<T>) Linked List Queue (and Queue<T> ) Stack (and Stack<T> ) Tree. What's a major problem with arrays?.

Download Presentation

CIS 3260

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIS 3260 • Week 7 (Data Structures)

  2. Terms to Know FIFO LIFO Generics Hashtable Dictionary<T> • Linked list • ArrayList • (and List<T>) • Linked List • Queue (and Queue<T>) • Stack (and Stack<T>) • Tree

  3. What's a major problem with arrays? • We have to know its size before we can declare it.

  4. The Linked List null

  5. The Stack Last In, First Out The Queue First In, First Out

  6. But ... what can go in these classes? • What if we want type-safety? "Generics"

  7. The ArrayList class

  8. using System;using System.Collections;public class SamplesArrayList {public static void Main() { // Creates and initializes a new ArrayList. ArrayList myAL = new ArrayList(); myAL.Add("Hello"); myAL.Add("World"); myAL.Add("!"); // Displays the properties and values of the ArrayList. Console.WriteLine( " Count: {0}", myAL.Count ); Console.WriteLine( " Capacity: {0}", myAL.Capacity ); Console.Write( " Values:" ); PrintValues( myAL ); }public static void PrintValues( ArrayList myList ) {foreach ( Object obj in myList ) Console.Write( " {0}", obj ); }}

  9. Trees

  10. null ... [ ]

  11. Graph

More Related