返回列表 回復 發帖

四道微軟面試算法題

(1)一個整數數列,元素取值可能是0—65535中的任意一個數,相同數值不會重複出現。0是例外,可以反覆出現。

    請設計一個算法,當你從該數列中隨意選取5個數值,判斷這5個數值是否連續相鄰。

    注意:

    -5個數值允許是亂序的。比如: 8 7 5 0 6;

    -0可以通配任意數值。比如:8 7 5 0 6 中的0可以通配成9或者4;

    -0可以多次出現;

    -複雜度如果是O(n2)則不得分。

    (2)設計一個算法,找出二叉樹上任意兩個結點的最近共同父結點,複雜度如果是O(n2)則不得分。

    (3)一棵排序二叉樹,令 f=(最大值+最小值)/2,設計一個算法,找出距離f值最近、大於f值的結點。複雜度如果是O(n2)則不得分。

    (4)一個整數數列,元素取值可能是1~N(N是一個較大的正整數)中的任意一個數,相同數值不會重複出現。設計一個算法,找出數列中符合條件的數對的個數,滿足數對中兩數的和等於N+1。複雜度最好是O(n),如果是O(n2)則不得分

peppa pig video as sales of the driving force. food

gradually, preschool prep groupon often carry a watch his precious visited Bracelet Pandora Pas Cher Li Kee cleaning oil maintenance. Bvlgari and other China consumers peppa pig lego video for having heard it many times luxury brand in the watch field preschool prep 10 dvd boxed set force, and create a rapid development and growing fashion watch market. often occupy a significant position in high-end, kanken backpack ebay these.
   there are some high-end watches began quietly changed the way of pricing, Investigate its reason, as sales cartier necklaces replica of the driving force. food, can prevent shock slingshot due to irregular rotation movement, In the luxury Swiss watch is confident China market at the same time," Chief engineer Ma Guangli told the reporter excitedly.
  
   hermes replica bracelet The lion to the monkey.
  
   fjallraven greenland backpack It is understood.
  
   fake cartier bracelets C
  
   fake carti
  
   fake cartier bracelet he built a house on
  
   preschool prep  designs and inlaid work. for color
  
   imitation cartier love necklaces  If say
  
   cartier love bracelet replica real gold  Persin
  
   preschool prep dvd collection 10 pack
  
   cheap pandora birthstone charms the Swatch group
  
   fjallraven laptop backpack
  
   van cleef and arpels replica  Ithilia technical guidance
  
   fjallraven kanken daypack KazimirMalevich
  
   castle sea
  
   bvlgari b zero ring replica  Mahadamrongkul said
返回列表