您好,欢迎光临本网站![请登录][注册会员]  
文件名称: Address Book with Multiple Field Search(个人信息管理系统)
  所属分类: C/C++
  开发工具:
  文件大小: 6mb
  下载次数: 0
  上传时间: 2013-10-22
  提 供 者: wys***
 详细说明: Address Book with Multiple Field Search Create an address book that can provide search functionality on multiple fields, with a large number of records.  The structure is very simple – first name, last name, phone number and city name.  You can search on ANY of these fields, and can search partially using “begins with” syntax. For example, you can search for – first name starts with “Ron…”.  Another search can be – phone number starts with “202…”. Obviously, binary search will play a role here. So, you can try to keep the list sorted. But one interesting aspect to consider is that we can search on ANY of those attributes. That is, the user will give it a few searches (some on first name, some on last name, some on telephone number, some on city). The Main Point The time to search in an unsorted list is O(n). The time to search in a sorted list is O(log n). But the time to sort a list is O(n log n). If you sort it on demand, and then search, that will take O(n log n + log n), that is O(n log n) time, which is worse than O(n). If the user were to change the “criteria” on every query, you would need to sort it every time. How can we make the searching work, without having to sort it on every request? Simplifying Assumptions For convenience, assume that none of the fields have spaces or commas in them, so you can read a comma separated file without worrying about those (non-algorithm related) complications. No need to consider a “contains” or “ends with” search. Don’t worry about duplicate results. Submission Method Hard copy: Submit a one page write-up that includes a brief description, and test results by input size. Specifically include initialization time graph (time versus list size), and average search time graph (time versus list size). Soft copy: Write up, test results data, and source code. Be ready to demonstrate the program. What you can share with each other Data files etc. Sample Program Run AddressBook mylist.csv Welcome to Addressbook, initialized. What would you like to search on? (F,L,P,C) F Enter the partial First Name Ron Results: Ronald Reagan, Ron de Silva… (43 total matches), 71 ms Another Search? (Y,N) Y What would you like to search on? (F,L,P,C) L Enter the partial Last Name Hug Results: Paul Hughes, Victor Hugo … (11 total matches), 86 ms Another Search? (Y,N) Y What would you like to search on? (F,L,P,C) C Enter the partial city name Bo Results: Boston, Boston, Boston, Boise … (102 total matches), 91 ms ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 输入关键字,在本站1000多万海量源码库中尽情搜索: