• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/3

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

3 Cards in this Set

  • Front
  • Back

What are generic types and how do they relate to collections/ADTs?

Generic types were created to assist with collections, where they specify what typr of object it will hold and what will be returned, rather than having to cast the output or create wrapper classes.

How does a seletion sort algorithm work? What is its worst case behaviour?

A selection sort algorithm looks for the smallest element, moves it to the end and then looks for the next lowest element. It's worst case behaviour is O(n^2)

How does a merge sort algorithm work? What is its worst case behaviour?

A merge sort is a recursive algorithm that uses divide and conquer technique to sort arrays. It first divides the array in half, it then conquers by recursively sorting each half, by continuously halving arrays until they are the same size as the base case (a subarray containing fewer than two elements as an array with 0 or 1 element is already sorted) these are then combined in the third step. It's worst case behaviour is O(nlogn)