📅  最后修改于: 2023-12-03 15:27:17.264000             🧑  作者: Mango
作为瞻博网络的一次面试经验,第四组是校园内的一次面试。瞻博网络是一家专注于移动WEB应用的互联网公司,主要提供基于微信生态的移动服务和应用。在这次面试中,我们主要考察应聘者的算法和数据结构的基础知识,以及对移动技术的了解程度。
def quick_sort(nums):
if len(nums) <= 1:
return nums
pivot = nums[0]
left = []
right = []
for num in nums[1:]:
if num <= pivot:
left.append(num)
else:
right.append(num)
return quick_sort(left) + [pivot] + quick_sort(right)
def find_index(sorted_nums, target):
left = 0
right = len(sorted_nums) - 1
while left <= right:
middle = (left + right) // 2
if sorted_nums[middle] == target:
return middle
elif sorted_nums[middle] < target:
left = middle + 1
else:
right = middle - 1
return -1
def reverse_linked_list(head):
if not head or not head.next:
return head
pre = None
current = head
while current:
next_node = current.next
current.next = pre
pre = current
current = next_node
return pre
def reverse_string(string):
return ' '.join(word[::-1] for word in string.split(' '))
print(reverse_string('hello world')) # olleh dlrow