gpt4 book ai didi

algorithm - 来自谷歌的面试题

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:38:23 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Given a 2d array sorted in increasing order from left to right and top to bottom, what is the best way to search for a target number?

Google 面试中提出了以下问题:

You are given a 2D array storing integers, sorted vertically and horizontally.

Write a method that takes as input an integer and outputs a bool saying whether or not the integer is in the array.

最好的方法是什么?它的时间复杂度是多少?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com