想谈一场恋爱,交心知情,性爱是水到渠成以后再说的后话 (转载)# Piebridge - 鹊桥
h*3
1 楼
店面碰到这个题目:
Amazon will start a new marketing campaign targeting the users according to
their purchasing profiles.
This campaign has 3 kinds of messages each one targeting one group of
customers:
Message 1 - targets the 25% of customers that spend most money at the
site
Message 2 - targets the 25% of customers that spend least money at the
site
Message 3 - targets the rest of the customers.
Given the list of purchases made during the week, write a program that lists
what kind of message each customer will receive.
Each purchase in this list features the customer id, the purchase amount
among other information.
对 purchases 累加每个 customer id 的 purchase amount,然后按purchase amount
进行排序,选出前25%, 后25%, 以及中间的。
没有想清楚, purchases record 用什么数据结构,这样累加和排序比较快。
设计的接口函数是
LinkedList Func(LinkedList
lastweekpurchaseRecords);
Amazon will start a new marketing campaign targeting the users according to
their purchasing profiles.
This campaign has 3 kinds of messages each one targeting one group of
customers:
Message 1 - targets the 25% of customers that spend most money at the
site
Message 2 - targets the 25% of customers that spend least money at the
site
Message 3 - targets the rest of the customers.
Given the list of purchases made during the week, write a program that lists
what kind of message each customer will receive.
Each purchase in this list features the customer id, the purchase amount
among other information.
对 purchases 累加每个 customer id 的 purchase amount,然后按purchase amount
进行排序,选出前25%, 后25%, 以及中间的。
没有想清楚, purchases record 用什么数据结构,这样累加和排序比较快。
设计的接口函数是
LinkedList
lastweekpurchaseRecords);