introduction
play

Introduction CptS 223 Advanced Data Structures Larry Holder - PowerPoint PPT Presentation

Introduction CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Advanced Data Structures Why not just use a big array? Example problem Search


  1. Introduction CptS 223 – Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1

  2. Advanced Data Structures � “Why not just use a big array?” � Example problem � Search for a number k in a set of N numbers � Solution � Store numbers in an array of size N � Iterate through array until find k � Number of checks 15 10 22 3 12 19 27 � Best case: 1 (k= 15) � Worst case: N (k= 27) � Average case: N/2 2

  3. Advanced Data Structures � Solution # 2 � Store numbers in a binary search tree � Search tree until find k 15 � Number of checks 10 22 � Best case: 1 (k= 15) 3 12 19 27 � Worst case: log 2 N (k= 27) � Average case: (log 2 N) / 2 3

  4. Analysis � Does it matter? � N vs. (log 2 N) 100 90 80 Number of Checks 70 60 N 50 log2 N 40 30 20 10 0 10 20 30 40 50 60 70 80 90 100 N 4

  5. Analysis � Does it matter? � Assume � N = 1,000,000,000 � 1 billion (Walmart transactions in 100 days) � 1 Ghz processor = 10 9 cycles per second � Solution # 1 (10 cycles per check) � Worst case: 1 billion checks = 10 seconds � Solution # 2 (100 cycles per check) � Worst case: 30 checks = 0.000003 seconds 5

  6. Advanced Data Structures � Moral � Appropriate data structures ease design and improve performance � Challenge � Design appropriate data structure and associated algorithms for a problem � Analyze to show improved performance 6

  7. Course Overview � Advanced data structures � Trees, hash tables, heaps, disjoint sets, graphs � Algorithm development and analysis � Insert, delete, search, sort � Applications � Object-oriented implementation in C+ + 7

  8. Course Details � Course website www.eecs.wsu.edu/~ holder/courses/CptS223.html � Email list � Homework 0: Send me your name and email address To: holder@wsu.edu Subject: Student in 223 Name: … Email: … 8

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend