Coding Husky

  • 首页

  • 关于

  • 标签

  • 归档

微软笔试题 HihoCoder#1136: Professor Q's Software 题解

发表于 2015-12-03 | 更新于 2017-08-22 |

题目来源

题目: http://hihocoder.com/problemset/problem/1136

阅读全文 »

数组中出现次数最多的K个数

发表于 2015-12-03 | 更新于 2017-08-22 |

前几天Google onsite面试,已挂。今天仔细思考了面试中一道没写出来的题,发现也并不难。诶,只能怪当时脑抽了。

题目大意

给定一个巨大的无序数组,输出数组中出现次数最多的K个数。

阅读全文 »

STL中heap相关函数的用法

发表于 2015-12-03 |

函数说明

参数都是一样的:

make_heap(first ,last)
make_heap(first ,last, cmpObject)

将[first, last)范围进行堆排序,默认使用less<int>, 即最大元素放在第一个。

pop_heap(first ,last)
pop_heap(first ,last, cmpObject)
阅读全文 »

删除链表中重复的结点 Delete duplicated nodes in linked list

发表于 2015-12-03 | 更新于 2015-12-08 |

在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针。例如,链表 1->2->3->3->4->4->5 处理后为 1->2->5

题解

这题看似很简单,但是务必考虑如下情形:

阅读全文 »

逆序对问题的求解 Solution of Inverse-Pairs Problem

发表于 2015-12-03 |

时间复杂度最低的方法是,修改归并排序(Merge Sort),在排序同时对逆序对计数。时间复杂度为 \(O(n\log{n})\)。

阅读全文 »

C99/GNU99对inline关键字的处理不同于C89

发表于 2015-12-03 |

C99 inline semantics are often misunderstood. The inline specifier serves two purposes:

First, as a compiler hint in case of static inline and extern inline declarations. Semantics remain unchanged if you remove the specifier.

Second, in case of raw inline (ie without static or extern) to provide an inline definition as an alternative to an external one, which has to be present in a different translation unit. Not providing the external one is undefined behaviour, which will normally manifest as linking failure.

阅读全文 »

C语言malloc创建struct同时初始化成员变量

发表于 2015-12-02 | 更新于 2015-12-08 |

写过C程序都知道,malloc了新的struct之后,经常跟着一大串的赋值。其实这些可以用一行漂亮的代码搞定。

先上代码:

1
2
3
4
#define new(type, ...) ({\
type* __t = (type*) malloc(sizeof(type));\
*__t = (type){__VA_ARGS__};\
__t; })
阅读全文 »

阿里巴巴平台型产品经理 实习生面试经历

发表于 2015-12-02 | 更新于 2015-12-08 |

前段时间脑子一热就投了阿里巴巴的平台型产品经理。这段时间一直忙自己的事情,也没时间顾及这个面试。昨天晚上查了下资料,平台型产品经理是今年才有的职位,所以网上也没有什么资料,于是改改PPT就睡了(PPT是阿里面试前发邮件给大家要求做的作业)。

阅读全文 »

微软、Google、腾讯、摩根士丹利IT 实习面试经历

发表于 2015-12-02 | 更新于 2015-12-08 |

博主是一只大三渣本,计算机专业。三月份开学之后,各种实习机会纷纷开始,以死猪不怕开水烫的陆续投了五家业内顶尖的公司,拿到了4个Offer。能有这样的结局也出乎我预料,为了照顾以后的学弟学妹们,在此把我的经历和体会都记下来。

阅读全文 »
1…910
Eric Fu

Eric Fu

99 日志
1 分类
34 标签
© 2015 – 2022 Eric Fu