Redian新闻
>
想谈一场恋爱,交心知情,性爱是水到渠成以后再说的后话 (转载)
avatar
想谈一场恋爱,交心知情,性爱是水到渠成以后再说的后话 (转载)# 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);
avatar
a*a
2
【 以下文字转载自 GenderEquality 讨论区 】
发信人: aaiya (笑笑), 信区: GenderEquality
标 题: 想谈一场恋爱,交心知情,性爱是水到渠成以后再说的后话
发信站: BBS 未名空间站 (Sun Oct 23 07:00:04 2011, 美东)
男38+,离异无子女,1.73M,正常身材,儒雅,有耐心,负责任,在西雅图地区
征成熟温柔的女性,相互尊重为先,两情相悦为本。希望谈一场恋爱,交心知情。。。
性爱吗,那是水到渠成,两情相悦情浓时的后话啊。。。
站内联系,谢谢
avatar
s*c
3
这题一定要所有客户的都排序吗
avatar
h*3
4
each customer

【在 s***c 的大作中提到】
: 这题一定要所有客户的都排序吗
avatar
s*c
5
找到top25和bottom25是不是就可以了
avatar
h*3
6
用什么数据结构加速排序?

【在 s***c 的大作中提到】
: 找到top25和bottom25是不是就可以了
avatar
y*g
7
先aggregate 然后不需要全部排序 类似top-k quick sort部分排序 找出分割线即可
avatar
h*3
8

对,找出分割线,部分排序即可。
what do you mean aggregate ?
sum up the total purchase of each customer during that week.
Or, some other operations ?

【在 y***g 的大作中提到】
: 先aggregate 然后不需要全部排序 类似top-k quick sort部分排序 找出分割线即可
avatar
y*g
9
sum up
简单点就一个map

【在 h*******3 的大作中提到】
:
: 对,找出分割线,部分排序即可。
: what do you mean aggregate ?
: sum up the total purchase of each customer during that week.
: Or, some other operations ?

avatar
d*y
10
建个bucket list。有了统计结果后就知道那个bucket以上是25%,哪个是25%以下。用
户对号入座就可以了

to

【在 h*******3 的大作中提到】
: 店面碰到这个题目:
: 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.

avatar
h*3
11
就是对 bucket list 进行 top k quick sort.
能把bucket list摊开来讲讲么?

【在 d********y 的大作中提到】
: 建个bucket list。有了统计结果后就知道那个bucket以上是25%,哪个是25%以下。用
: 户对号入座就可以了
:
: to

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。