data structure min chen school of computer science and engineering seoul national university

10
COURSE PROJECTS Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Upload: ross-perry

Post on 14-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

COURSE PROJECTS

Data Structure

Min Chen

School of Computer Science and Engineering

Seoul National University

Page 2: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 1: Peg Solitaries

Requirements:Design a Peg Solitaries Game

Page 3: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 1: Specification

GUIEither command line or graphic interfaceBetter GUI will get incentive

* * *

* * *

* * * * * * *

* * * O * * *

* * * * * * *

* * *

* * *

Move (a,b) to (c,d)

Page 4: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 1: Specification

System DesignChessboard Class

○ Display the chessboard and chessman○ Display the deletion of each move

Judgment System○ If one move is valid○ If game ended

Solution Algorithm○ Calculate the solution for the game

Page 5: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 2: Path Discovery

Requirements:Create a random mazeDiscover a shortest path in a maze

GUIEither command line or graphic interfaceBetter GUI will get incentive

Page 6: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 2: Specification

Create the maze

Line Maze Block Maze

Entrance

Exit

I

O

Page 7: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 2: Specification

Discover the shortest path

I

O

1 2 3 4 5 760

1

0

23

4

5

7

6

X

X

XX X X

X X XX X X

X X X

X X X

X X X

X X XX X X

X X X

XX

XX

X

X

X

A Breadth-First Approach

Page 8: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 3: Compress

Requirements:Give a txt file

○ Contains 52 English letters (‘a’-’z’)&(‘A’-’Z’)○ Contains ‘ ’(blanks), ‘,’ (commas), ‘.’(periods)○ Contains numbers (‘0’-’9’)

Compress the txt file by Huffman Codes○ The compressed file should be smaller than

original fileUncompress the file into original txt file

○ Should restore the original file

Page 9: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Project 3: Specification

How to calculate the Huffman Codes?① Statistics of occurrence times of each char

② Form the Huffman Tree

③ Get the Huffman Codes from the tree

Page 10: Data Structure Min Chen School of Computer Science and Engineering Seoul National University

Principles

Don’t Copy Codes from Internet Try your best for a better solution!