日期:2014-05-20  浏览次数:20631 次

求救!!!作业题,各位大大帮忙
可能有点多,麻烦了!!!我真的很急啊!
1).   Product   Catalog   Search   Indexing
1a).   Draw   the   entity-relationship   (ER)   diagram   for   a   Product   Catalog.

Sample   Data:

Catalog   “A”   contains
Category   “A1”   contains
Products   P1   ($1.99),   P2   ($2.99),   P3   ($3.99),   P4   ($4.99)
Category   “A2”   contains
Category   “A21”   contains
Products   P5   ($5.99),   P6   ($6.99)
Category   “A22”   contains
Products   P7   ($7.99),   P8   ($8.99)

Catalog   “B”   contains
Category   “B1”   contains
Category   “B11”   contains
Products   P1   ($11.99),   P2   ($12.99)
Category   “B12”   contains
Products   P3   ($13.99),   P4   ($14.99)
Category   “B2”
Products   P5   ($15.99),   P6   ($16.99),   P7   ($17.99),   P8   ($18.99)

Hints:
• This   is   NOT   a   Binary   Tree.     A   Category   may   contain   more   than   two   (2)   Child-Categories,   and/or   more   than   two   (2)   Child-Products.     For   example,   Category   A1   contains   four   (4)   Products:   P1,   P2,   P3   and   P4.
• Prices   are   “attached   to”   Category   –   Product   combinations.     As   such,   Prices   are   Category   specific.     For   example,   under   Catalog   A   ->   Category   A1,   Product   P1   is   $1.99.     Under   Catalog   B   ->   Category   B1   ->   Category   B11,   Product   P1   is   $11.99.
• Product   may   show   up   in   different   Catalogs   and   Categories.     For   example,   Product   P1   shows   up   under   Catalog   A   ->   Category   A1,   but   also   shows   up   under   Catalog   B   ->   Category   B1   ->   Category   B11.

 
1b).   Design   and   implement,   in   Java   /   C#   /   C++,   the   data   structure   and   algorithm   for   generating   a   Product   Search   Index   Table   from   the   Product   Catalog.

Sample   Input:   (Same   as   the   Sample   Data   in   #1a)

Catalog   “A”   contains
Category   “A1”   contains
Products   P1   ($1.99),   P2   ($2.99),   P3   ($3.99),   P4   ($4.99)
Category   “A2”   contains
Category   “A21”   contains
Products   P5   ($5.99),   P6   ($6.99)
Category   “A22”   contains
Products   P7   ($7.99),   P8   ($8.99)

Catalog   “B”   contains
Category   “B1”   contains
Category   “B11”   contains
Products   P1   ($11.99),   P2   ($12.99)
Category   “B12”   contains
Products   P3   ($13.99),   P4   ($14.99)
Category   “B2”