由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问一道glassdoor上面的面试题
相关主题
一个Google面试题[合集] 一个Credit Suisse的quant面试题
问道看到的面试题问一道算法题
急问一个面试题,不知该如何回答?请高人给个思路!谢谢!我花了一个小时才调通过这个程序
面试题库除了careercup还有哪里有?有这样的东西么(描述见内)another google interview question:
请教一道面试题一道微软题
问一道面试题google interview question
请教一个题 string similarity一道program challenge的题
[合集] 面试题 - white elephant gift exchange请教一道面试题
相关话题的讨论汇总
话题: input话题: glassdoor话题: 面试题话题: code话题: output
进入JobHunting版参与讨论
1 (共1页)
r***c
发帖数: 95
1
在glassdoor上看到这个面试题,但是我不明白题目是什么意思。
貌似大家能看懂,而且提供了code solution。
不想看code,希望大侠能够帮忙解释一下题目含义。谢谢!
If the input is 6, then output should be the series 6 3 10 5 16 8 4 2 1,
similarly if input is 10 then it should be 10 5 16 8 4 2 1, and if input is
4 then output is 4 2 1.
s******7
发帖数: 1758
2
如果是偶数,除二,如果是奇数,前两个相加再加1,直到最后等于1
h****3
发帖数: 89
3
如果第一个数(input)就是奇数怎么办?
l******s
发帖数: 3045
4
补上前面的2*input?

【在 h****3 的大作中提到】
: 如果第一个数(input)就是奇数怎么办?
A*******e
发帖数: 2419
5
不想看code
why not?

,
is

【在 r***c 的大作中提到】
: 在glassdoor上看到这个面试题,但是我不明白题目是什么意思。
: 貌似大家能看懂,而且提供了code solution。
: 不想看code,希望大侠能够帮忙解释一下题目含义。谢谢!
: If the input is 6, then output should be the series 6 3 10 5 16 8 4 2 1,
: similarly if input is 10 then it should be 10 5 16 8 4 2 1, and if input is
: 4 then output is 4 2 1.

b***e
发帖数: 1419
6
不想看code想看英文么?
https://en.wikipedia.org/wiki/Collatz_conjecture
这时一个著名的停机问题猜想。跟哥德巴赫猜想性质类似。

,
is

【在 r***c 的大作中提到】
: 在glassdoor上看到这个面试题,但是我不明白题目是什么意思。
: 貌似大家能看懂,而且提供了code solution。
: 不想看code,希望大侠能够帮忙解释一下题目含义。谢谢!
: If the input is 6, then output should be the series 6 3 10 5 16 8 4 2 1,
: similarly if input is 10 then it should be 10 5 16 8 4 2 1, and if input is
: 4 then output is 4 2 1.

l*********u
发帖数: 19053
7
"前两个相加再加1",前面的=0

【在 h****3 的大作中提到】
: 如果第一个数(input)就是奇数怎么办?
r***c
发帖数: 95
8
谢谢!

【在 s******7 的大作中提到】
: 如果是偶数,除二,如果是奇数,前两个相加再加1,直到最后等于1
r***c
发帖数: 95
9
谢谢回复。
If n is even, divide it by 2 to get n / 2.
If n is odd, multiply it by 3 and add 1 to obtain 3n + 1.
Repeat the process (which has been called "Half Or Triple Plus One", or
HOTPO[6]) indefinitely.
The conjecture is that no matter what number you start with, you will always
eventually reach 1.
这个和二楼说的情形,一样么?
嗯,想自己写,所以不想看别人的code,嘿嘿。

【在 b***e 的大作中提到】
: 不想看code想看英文么?
: https://en.wikipedia.org/wiki/Collatz_conjecture
: 这时一个著名的停机问题猜想。跟哥德巴赫猜想性质类似。
:
: ,
: is

1 (共1页)
进入JobHunting版参与讨论
相关主题
请教一道面试题请教一道面试题
请问一道google面试题问一道面试题
问个array in place operation的题目请教一个题 string similarity
P家面经[合集] 面试题 - white elephant gift exchange
一个Google面试题[合集] 一个Credit Suisse的quant面试题
问道看到的面试题问一道算法题
急问一个面试题,不知该如何回答?请高人给个思路!谢谢!我花了一个小时才调通过这个程序
面试题库除了careercup还有哪里有?有这样的东西么(描述见内)another google interview question:
相关话题的讨论汇总
话题: input话题: glassdoor话题: 面试题话题: code话题: output