SortingGame - Aalto · Learning goals of the games: Recognizing properties of sorting algorithms...

1
Stable Ɵ (N²) Based on comparing individual digits of keys Insertion sort Radix exchange sort Bubble sort Selection sort Heap- sort Recursive Ω (N log N) Victory stack Player 2 Player 1 0 points Victory stack 0 points Player 1 starts by capturing two cards. Based on comparing individual digits of keys Radix exchange sort Bubble sort Selection sort Heap- sort Recursive Ω (N log N) Player 2 Player 1 3 points Victory stack 0 points In-place Player 2 captures 3 cards from the table. Quicksort Mergesort Heapsort Stable In-place O (n log n) Worst case (default) Active criteria Player 4 Player 3 You It is your turn to start the algorithm round. Which card do you choose? Player 2 Turn begins Can you capture a card from the table with any of your hand cards? Place 1 hand card to the table By using 1 hand card, capture as many cards from the table that you can. Does any of the players disagree with the captures? Discuss and find out the correct solution. Were you right? Give 1 card from your victory stack to the other player's victory stack. The other player must give 1 card from his/her victory stack to your victory stack. Were all cards noticed that can be captured from the table? Any of the other players can claim the cards that can be captured with your card, but were left on the table. Do you have any hand cards left? Each player draws 4 hand cards. Cards can be from either deck. Yes Yes No No No Yes Yes No Yes No Deal 6 cards to the table (3 algorithm and 3 special cards) and 4 cards (2+2) for each player. Turn begins Place one special card to the table. There are 2 spots for criterion cards and 1 spot for "best/avg/worst case" -cards on the table. If the corresponding spots are full, you can cover some of the previously played cards with your card. Has everyone played special card round? Algorithm phase begins Turn begins Pass Put one algorithm card to the table. The algorithm should fulfill all the criteria in the special cards played to the table. Does any of the players disagree with your algorithm's validity? Pass Discuss and find out the correct solution. Were you right? Give 1 card from your victory stack to the other player's victory stack. The other player must give 1 card from his/her victory stack to your victory stack. Has everyone played algorithm round? Winner of the round is the player whose algorithm's asymptotical time complexity is the best. Winner takes all the cards on the table and in the pot to his or her victory stack. In case of a tie, the cards are divided equally. Give 1 card from your victory stack to the pot. Deal 3 algorithm cards and 2 special cards for each player. Draw new cards so that every player has 5 hand cards including at least 1 algorithm card and 1 special card. No Yes Yes No No Yes Special card phase begins No Yes Lasse Hakulinen Dept. of Computer Science and Engineering Aalto University School of Science Finland [email protected] Card Games for Teach- ing Data Struc- tures and Algo- rithms SortingGame and SortingCasino Learning goals of the games: Recognizing properties of sorting algorithms and understanding related concepts, such as: stable, in-place and big O notation. Both games use 2 decks of cards: 1) Algorithm deck: Contains names of sorting algorithms. 2) Special card deck: Contains criteria related to sorting algorithms. In SortingGame, contains also cards that determine whether the game deals with the best/average/worst case scenarios of the algorithms. There is also a "Robbery card" -extension for SortingGame where players can steal cards by matching an algorithm or criterion with it's description. Data structures and algorithms have many elements and rules that can be used to design educational games. SortingGame and SortingCasino are games that deal with sorting algorithms and concepts related to them. The fundamental idea of both games is to raise questions that the players need to find answers to, rather than to provide direct answers. Overview SortingGame Play until either deck is empty Winner is the player with most cards in victory stack SortingCasino Play until either deck is empty Each card in victory stack gives +1 point Clearing a table gives +3 points Winner is the player with most points Based on comparing individual digits of keys Radix exchange sort Recursive Ω (N log N) Player 2 Player 1 3 points 4 points Player 1 captures the last card from the table. He receives 3 additional points for clearing the table.

Transcript of SortingGame - Aalto · Learning goals of the games: Recognizing properties of sorting algorithms...

Page 1: SortingGame - Aalto · Learning goals of the games: Recognizing properties of sorting algorithms and understanding related concepts, such as: stable, ... Special card deck: Contains

Stable Ɵ (N²)

Based oncomparingindividualdigits of

keys

Insertionsort

Radixexchange

sort

Bubblesort

Selectionsort

Heap-sort

Recursive Ω (N log N)Victorystack

Player 2

Player 1

0 points

Victorystack

0 points

Player 1 starts by capturing two cards.

Based oncomparingindividualdigits of

keys

Radixexchange

sort

Bubblesort

Selectionsort

Heap-sort

Recursive Ω (N log N)

Player 2

Player 1

3 points

Victorystack

0 points

In-place

Player 2 captures 3 cards from the table.

Quicksort Mergesort Heapsort Stable

In-place O (n log n)Worstcase(default)

Active criteria

Pla

yer

4

Player 3

You

It is your turn to start the algorithm round. Which card do you choose?

Pla

yer 2

Turn begins

Can you capture a cardfrom the table with anyof your hand cards?

Place 1 hand cardto the table

By using 1 hand card,capture as many cardsfrom the table that youcan.

Does any of the playersdisagree with the captures?

Discuss and find outthe correct solution.Were you right?

Give 1 card fromyour victory stackto the other player'svictory stack.

The other player must give 1 cardfrom his/her victorystack to your victorystack.

Were all cards noticedthat can be capturedfrom the table?

Any of the otherplayers can claimthe cards that canbe captured with yourcard, but were left on the table.

Do you have any handcards left?

Each player draws 4 hand cards. Cards canbe from either deck.

YesYes

No

No

NoYes

Yes

No

Yes No

Deal 6 cards to the table (3 algorithm and 3 special cards)and 4 cards (2+2) for each player.

Turn begins Place one special card to the table.

There are 2 spots for criterion cards and 1 spot for "best/avg/worst case"-cards on the table. If the correspondingspots are full, you can cover some of the previously played cards with your card.Has everyone played

special card round?

Algorithm phase begins

Turn begins

Pass

Put one algorithm card to the table. The algorithmshould fulfill all the criteriain the special cards playedto the table.

Does any of the playersdisagree with your algorithm'svalidity?

Pass

Discuss and find outthe correct solution.Were you right?

Give 1 card fromyour victory stackto the other player'svictory stack.

The other player must give 1 cardfrom his/her victorystack to your victorystack.

Has everyone playedalgorithm round?

Winner of the round is the player whose algorithm's asymptotical time complexity is the best. Winner takes all the cards on the table and in the pot to his or her victory stack. In case of a tie, the cards are divided equally.

Give 1 card from your victory stackto the pot.

Deal 3 algorithm cards and2 special cards for each player.

Draw new cards so that every player has 5 hand cards including at least 1 algorithm card and 1 special card.

No

Yes

Yes

No

No

Yes

Special card phase begins

No

Yes

Lasse HakulinenDept. of Computer Science and Engineering

Aalto University School of ScienceFinland

[email protected]

CardGames for

Teach-ing

Data Struc-tures and Algo-rithms

SortingGame and SortingCasino

Learning goals of the games: Recognizing properties of sorting algorithms and understanding related concepts, such as: stable, in-place and big O notation.

Both games use 2 decks of cards: 1) Algorithm deck: Contains names of sorting algorithms. 2) Special card deck: Contains criteria related to sorting algorithms. In SortingGame, contains also cards that determine whether the game deals with the best/average/worst case scenarios of the algorithms.

There is also a "Robbery card" -extension for SortingGame where players can steal cards by matching an algorithm or criterion with it's description.

Data structures and algorithms have many elements and rules that can be used to design educational games. SortingGame and SortingCasino are games that deal with sorting algorithms and concepts related to them.The fundamental idea of both games is to raise questions that the players need to find answers to, rather than to provide direct answers.

Overview

SortingGamePlay until either deck is emptyWinner is the player with mostcards in victory stack

SortingCasinoPlay until either deck is emptyEach card in victory stack gives +1 pointClearing a table gives +3 pointsWinner is the player with most points

Based oncomparingindividualdigits of

keys

Radixexchange

sort Recursive Ω (N log N)

Player 2

Player 1

3 points

4 points

Player 1 captures the last card from the table. Hereceives 3 additional points for clearing the table.