algorithm - 使用不同日期的购买清单为客户查找最有可能的购买
问题描述
我很难找到解决这个问题的有效方法。假设您在不同的日子用不同的品牌购买了这些商品。
String [] day1= {"Nike", "Adidas", "Croc"};
String [] day2= {"Adidas", "Croc", "Reebok"};
String [] day3= {"Croc", "Reebok", "Sketchers"};
然后,您必须为每个品牌打印最有可能购买的商品。
For example:
Nike -> Adidas, Croc //Adidas and Croc appears most times with Nike
Adidas -> Croc //Croc appears most times with Adidas
Croc -> Adidas //Adidas appears most times with Croc
我已经考虑了几个选项。就像使用地图来存储品牌之间的映射一样。但这需要遍历地图,我认为有一个更有效的算法。
谢谢
解决方案
推荐阅读
- pandas - pandas read_csv 不适用于分号分隔符
- python - 如何使用标签和图例自定义熊猫饼图
- google-bigquery - 在 BigQuery 上交叉应用的替代方法
- python - 是否可以创建一个条形图,其中 Y 是 Pandas 数据框中列的不同值的计数?
- javascript - 怎么获得从目录上传中获取单个文件?
- tcl - TCL命令让我可以得到上个月?
- javascript - 如何使用 jQuery-tagEditor 不允许用户手动编辑添加新标签?
- angular - 为什么 runOutsideAngular 和 detectChanges 的组合只重新初始化组件一次?
- javascript - 未捕获的错误:Bootstrap 的 JavaScript 需要 Vue 2.4 组件中的 jQuery
- javascript - Grails:将自定义 javaScript 添加到 f:all 中呈现的字段