2021
10-29
10-29
C++实现LeetCode(89.格雷码)
[LeetCode]89.GrayCode格雷码Thegraycodeisabinarynumeralsystemwheretwosuccessivevaluesdifferinonlyonebit.Givenanon-negativeintegernrepresentingthetotalnumberofbitsinthecode,printthesequenceofgraycode.Agraycodesequencemustbeginwith0.Forexample,givenn=2,return[0,1,3,2].Itsgraycodesequenceis:00-001-111-310-2Note:Foragivenn,agraycod...
继续阅读 >