Link Search Menu Expand Document

Lesson 9 - Data Structures

Objectives

  1. Working with Lists

    • Write a method to remove all odd numbers from the list of integers.

    • Side Quest: Take a peek at delegates and lambdas through List.RemoveAll(). Check out the source code of the method.

  2. Jagged vs Multidimentional arrays.

    • Write a method to return the sum of all the elements in a given matrix.
  3. Learn about Dictionaries and HashSets

    • Write a method to calculate the frequencies of the items in a given array. I.e. for [1, 3, 1, 5, 5, 7] it should return [{1, 2}, {3, 1}, {5, 2}, {7, 1}]

    • ** Side Quest: To learn about the internal workings of dictionaries check out this Wikipedia article: https://en.wikipedia.org/wiki/Hash_table

Home Assignments

  1. Watch a talk on recursion: https://www.youtube.com/watch?v=AfBqVVKg4GE

  2. Diagonal

  3. Lucky Numbers

  4. Duplicates

  5. ** Sudoku Validator