由买买提看人间百态

topics

全部话题 - 话题: multiset
首页 上页 1 2 (共2页)
p***y
发帖数: 637
1
来自主题: JobHunting版 - G onsite面经兼求内推
我这statics大概就是面试官说的multiSet
s**********k
发帖数: 88
2
来自主题: JobHunting版 - G onsite面经兼求内推
multiset比hashmap省空间
k****p
发帖数: 9
3
来自主题: JobHunting版 - 弱问C++用heap的题能用multiset吗
总感觉用红黑树代替heap有点overkill。 红黑树相对heap更加有序,虽然insert和
delete操作都是log(n),但红黑树前面系数会大很多。另外heap的getmin()或getmax()
O(1), 如果这个操作比较频繁的话,最好不要用红黑树。当然你可以改进红黑树,加个
max或min变量,也能到O(1)。
priority_queue不如自己写的heap灵活,不能update节点,比如不能用来实现http://www.geeksforgeeks.org/greedy-algorithms-set-7-dijkstras-algorithm-for-adjacency-list-representation/
k****p
发帖数: 9
4
来自主题: JobHunting版 - 弱问C++用heap的题能用multiset吗
那样可以用priority_queue。priority_queue的函数名和stack一样的,pop,push,top很
好记。
面试官怎么看,我也不清楚。面试经验不多。。。
另外那个题也可以两两merge。假设总长度N,heap复杂度O(Nlog(K))。 两两merge的话
,每轮最多2N(list奇数2N,偶数N)。有log(K)轮。
b******i
发帖数: 914
5
来自主题: JobHunting版 - 弱问C++用heap的题能用multiset吗
恩,有道理,两两merge
x*******9
发帖数: 138
6
来自主题: JobHunting版 - google onsite的套盒子题目
SPOJ MDOLLS
4A(有点蠢
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define print(x) cout << x << endl
#define input(x) cin >> x
int n;
vector > vec;
int main() {
int T;
int a, b;
input(T);
while (T--) {
input(n);
vec.clear();
multiset st;
for (int i = 0; i < n; i++) {
input(a >> b);
vec.push_back({a, b})... 阅读全帖
w*********e
发帖数: 49
7
来自主题: JobHunting版 - FLGU面经offer及杂谈
距离是按在array里的index算的,这题的point在于可以有重复的word
binary search tree也可以有重复key,看你怎么定义了,比如c++std里的multiset就
是有重复key的rb tree
A*******e
发帖数: 2419
8
来自主题: JobHunting版 - FLGU面经offer及杂谈
1.明白了。
2.直接在普通rb-tree上加个计数器不就好了吗?何必重复key?而且一直没搞懂,
multiset/multimap有什么必需应用么?
w*********e
发帖数: 49
9
来自主题: JobHunting版 - FLGU面经offer及杂谈
multimap比较好理解,就是一样的key不同的value
multiset确实等同于可key-count的map,但是据说在combinatorics里有应用,看了看
wiki没看懂
w*********e
发帖数: 49
10
来自主题: JobHunting版 - FLGU面经offer及杂谈
距离是按在array里的index算的,这题的point在于可以有重复的word
binary search tree也可以有重复key,看你怎么定义了,比如c++std里的multiset就
是有重复key的rb tree
A*******e
发帖数: 2419
11
来自主题: JobHunting版 - FLGU面经offer及杂谈
1.明白了。
2.直接在普通rb-tree上加个计数器不就好了吗?何必重复key?而且一直没搞懂,
multiset/multimap有什么必需应用么?
w*********e
发帖数: 49
12
来自主题: JobHunting版 - FLGU面经offer及杂谈
multimap比较好理解,就是一样的key不同的value
multiset确实等同于可key-count的map,但是据说在combinatorics里有应用,看了看
wiki没看懂
p**s
发帖数: 2707
13
题目里又没说A是集合,可以是multiset
n*********h
发帖数: 264
14
如果是multiset,题目倒是合理的;要是是集合,纯粹坑爹。
S**I
发帖数: 15689
15
来自主题: CS版 - 問一個數據結構的問題
Of course; for example, C++ STL has multiset and multimap, which allow
existence of elments with equivalent keys. Also, both of them have a member
function equal_range, which does exactly what you want.

a
C*******e
发帖数: 41
16
来自主题: Database版 - question
Thanks!
Since I was looking at relational/object DBMS, CAST
now is extended to user defined data type also, I guess,
in SQL extensions. And probabely MULTISET serves similar
function together with CAST, but I really couldn't find
this guy.
q*****g
发帖数: 72
17
string is sequential container
associative container: set, multiset, map, multimap
h*******s
发帖数: 8454
18
multiset就在set里面吧

STL
h*******s
发帖数: 8454
19
multiset就在set里面吧

STL
f*******n
发帖数: 12623
B*********h
发帖数: 800
21
来自主题: Quant版 - [合集] STL面试问题 (转载)
☆─────────────────────────────────────☆
zhuxi (主席) 于 (Fri Mar 9 21:09:04 2007) 提到:
发信人: zhuxi (主席), 信区: JobHunting
标 题: STL面试问题
发信站: BBS 未名空间站 (Fri Mar 9 13:29:12 2007)
如何往set(注意不是multiset)中insert多个相同的key?
没答上来。
☆─────────────────────────────────────☆
waterside (春波碧草) 于 (Fri Mar 9 21:12:46 2007) 提到:
可以这么做吗?
☆─────────────────────────────────────☆
alan (Super Colts!) 于 (Fri Mar 9 21:13:33 2007) 提到:
insert也没用啊

☆─────────────────────────────────────☆
wass (DoubleQuant) 于 (F
S*****H
发帖数: 90
22
1. What is Object?
2. What is Polymorphism? How to implement polymorphism?
3. What is Dynamic Binding and Static Binding?
4. What is OOP?
5. What are important features of OOP? Why OOP are better?
6. What is Class?
7. Difference between class and object.
8. What is enum? What is enum's limitation?
9. What are interface and abstract class?
10. How would you choose between an abstract class and interface?
11. What are struct and union?
12. What is the difference... 阅读全帖
S*****H
发帖数: 90
23
1. What is Object?
2. What is Polymorphism? How to implement polymorphism?
3. What is Dynamic Binding and Static Binding?
4. What is OOP?
5. What are important features of OOP? Why OOP are better?
6. What is Class?
7. Difference between class and object.
8. What is enum? What is enum's limitation?
9. What are interface and abstract class?
10. How would you choose between an abstract class and interface?
11. What are struct and union?
12. What is the difference... 阅读全帖
首页 上页 1 2 (共2页)