Careercup - Google面试题 - 5085331422445568
2014-05-08 23:45
原题:
How would you use Dijkstra's algorithm to solve travel salesman problem, which is to find a shortest path from a starting node back to the starting node and visits all other node exactly once.
题目:如何用Dijkstra算法来解决TSP问题?(谁会出这种题,这又是“Guy”从哪儿copy来的?)
解法:对于这种问题我不知道该说什么。一个多项式级别的算法来解决NP问题,这已经超出了面试题或者教科书的范畴吧?这个“Guy”自己写的代码都够呛,还能问别人这种问题,实在让人无力吐槽。Dijkstra算法用于解决单源最短路径问题,而且要求没有负权的边。就算是用其他算法来近似最优解,也应该用类似最小生成树的算法吧。所以我觉得这个“Guy”应该被永久禁止发帖,完全是在误导我们这些辛辛苦苦做面试题的人。找个工作容易吗?
代码:
// http://www.careercup.com/question?id=5085331422445568
// Answer:
// Dijkstra Algorithm is not for TSP, why would you expect to solve NP-hard problems with O(n ^ 2) efforts?
// Comment:
// 1. Difficult question.
// 2. Vague description.
// 3. Strange indication.
// 4. Stupid discussion.
// Based on the judgement above, I believe that 'guy' is a complete amateur. Excellent programmers don't ask stupid questions, but he did.
// The reason I'm complaining is that, he pretended to have google interview experience and posted a lot of fake questions only to trick us.
// He doesn't even know how to calculate the distance between two points?
// He doesn't know what volatile means.
// He keeps asking stupid questions.
// SO HOW THE HELL DOES THIS 'GUY' HAVE SO MANY GOOGLE INTERVIEWS?
// He's site reliability engineer at Boeing, really?
// I hate liars, especially foolish liars!
// Down vote for every question he posted.
int main()
{
return ;
}
Careercup - Google面试题 - 5085331422445568的更多相关文章
- Careercup - Google面试题 - 5732809947742208
2014-05-03 22:10 题目链接 原题: Given a dictionary, and a list of letters ( or consider as a string), find ...
- Careercup - Google面试题 - 4847954317803520
2014-05-08 21:33 题目链接 原题: largest number that an int variable can fit given a memory of certain size ...
- Careercup - Google面试题 - 6332750214725632
2014-05-06 10:18 题目链接 原题: Given a ,) (,) (,), (,) should be returned. Some suggest to use Interval T ...
- Careercup - Google面试题 - 5634470967246848
2014-05-06 07:11 题目链接 原题: Find a shortest path ,) to (N,N), assume is destination, use memorization ...
- Careercup - Google面试题 - 5680330589601792
2014-05-08 23:18 题目链接 原题: If you have data coming in rapid succession what is the best way of dealin ...
- Careercup - Google面试题 - 5424071030341632
2014-05-08 22:55 题目链接 原题: Given a list of strings. Produce a list of the longest common suffixes. If ...
- Careercup - Google面试题 - 5377673471721472
2014-05-08 22:42 题目链接 原题: How would you split a search query across multiple machines? 题目:如何把一个搜索que ...
- Careercup - Google面试题 - 6331648220069888
2014-05-08 22:27 题目链接 原题: What's the tracking algorithm of nearest location to some friends that are ...
- Careercup - Google面试题 - 5692127791022080
2014-05-08 22:09 题目链接 原题: Implement a class to create timer object in OOP 题目:用OOP思想设计一个计时器类. 解法:我根据自 ...
随机推荐
- 基于s5pv210嵌入式linux使用其他动态、静态库文件程序的交叉编译
刚刚移植了sqlite3迫切想测试一些,结果将原来在ubuntu系统下写好且测试通过的程序,重新编译就报错,无法找到已定义的函数 这是由于没有使用库或者使用了错误的就.库造成的结果. 正确做法为: a ...
- 配置server.xml后,启动tomcat 失败(Unable to start cluster)及解决方法
在配置负载均衡环境过程中修改server.xml 后重启tomcat报错,报错信息如下 [root@Alice bin]# ./catalina.sh runUsing CATALINA_BASE: ...
- ASP.Net MVC 5 高级编程 第7章 成员资格、授权和安全性
第7章 成员资格.授权和安全性 7.1 安全性 ASP.NET MVC 提供了许多内置的保护机制(默认利用 HTML 辅助方法和Razor 语法进行 HTML编码以及请求验证等功能特性,以及通过基架构 ...
- tomcat学习笔记2
LNMT在网站架构中的实现过程: Client --> http --> Nginx --> reverse_proxy (http) --> tomcat (http con ...
- android空鼠修改
抛弃盒子自带遥控器后,又不满意改键红外遥控器,选择飞鼠及无线键鼠成为最终方案.问题是:菜单键如何实现!其实很简单:即插即用USB无线飞鼠及键鼠套装只涉及2个文件:system/usr/layout/G ...
- ajax使用。
<script> function createAjax(){ var request=false; //window对象中有XMLHttpRequest存在就是非IE,包括(IE7,IE ...
- WIN10 64位下VS2015 MFC直接添加 halcon 12的CPP文件实现视觉检测
近段时间开始接触halcon,但是在VS2015里面使用,无论是配置还是生产EXE文件,都不如意. 加上网上的教程很多,经过多次测试,其实有很多地方无需修改,如果修改的太多也失去了直接添加封装的意义. ...
- 【转载!】关于C#的RawSocket编程的问题
Q:你好! 看过了你在csdn上发表的<用C#下的Raw Socket编程实现网络封包监视>,觉得很感兴趣,而且对我的帮助很大.不过在调试的过程中遇到一些问题,特此向你请教一下.谢谢! 首 ...
- jquery 匹配select下拉框与列表框
今天工作中用到 GrapyCity 的 wijmo ui 控件. 要给系统中所有类型的控件加统一样式 用法 $("input [type='text']").wijtext(); ...
- ASP.NET Core文章汇总
现有Asp.Net Core 文章资料,2016 3-20月汇总如下 ASP.NET Core 1.0 与 .NET Core 1.0 基础概述 http://www.cnblogs.com/Irvi ...