Treaps and a DVD Checkout System - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Treaps and a DVD Checkout System

Description:

Treaps and a DVD Checkout System. Jim Moiani. Michael Crocker. It's a tree... it's a heap... We used treaps to create a DVD rental system ... – PowerPoint PPT presentation

Number of Views:133
Avg rating:3.0/5.0
Slides: 10
Provided by: jamesm95
Category:
Tags: dvd | checkout | dvd | movies | new | rental | system | treaps

less

Transcript and Presenter's Notes

Title: Treaps and a DVD Checkout System


1
Treaps and a DVD Checkout System
  • Jim Moiani
  • Michael Crocker

2
Its a tree its a heap
  • A treap is a balanced binary search tree
  • Its node is similar to a binary search trees
    node (has pointer to left and right, and a key)
  • Also contains a random priority
  • Since the priorities are randomly assigned, nodes
    can be inserted like they would for a binary
    search tree, and then rotated so that the
    priorities of the nodes also maintain the
    properties of a heap

3
(No Transcript)
4
What do you use it for?
  • We used treaps to create a DVD rental system
  • Separate treaps for in-stock movies, checked-out
    movies, and a record of the membership
  • Features include ability to add new movies and
    members, display a members records, and check
    movies in and out

5
So what are the benefits?
  • Provides all the functionality of binary search
    trees, like inorder traversal, but also
    guarantees a T(lg n) search time
  • Of course, this is given that youve made enough
    insertions so that the priorities approach a
    normal distribution

6
Whats left to add? Possible Improvements
  • A GUI
  • Provides overdue notification could interface
    with a member account system (debit credit cards
    for overdue movies?)
  • A few member functions work by entering the
    member number could interface with a scanner
  • More info for DVDs, like UPC, release date,
    review notes, and other information

7
And one more
  • More treaps which are pointers to our member
    classes, which can be referenced to sort and
    display other categories quickly and easily
  • Sort DVDs by rating, release year, title, and so
    on
  • Sort members by name, location, member number
  • All without searching the whole treap!

8
(No Transcript)
9
And now, a demonstration
Write a Comment
User Comments (0)
About PowerShow.com