for i := 0; i < length / 2; i++ { other := length - i - 1 temp := n[i]
n[i] = n[other] n[other] = temp } }
func reverse(n []int) { for n / 2 раз }
Думаете O(log n)? Казалось бы да, но нет.
Ответ: O(n/2), т.к. мы просто один раз берем половину элементов массива и итерируем их, скажем было 100 элементов взяли половину - 50, для Big O это все те же n элементов, следовательно сложность алгоритма O(n)
for i := 0; i < length / 2; i++ { other := length - i - 1 temp := n[i]
n[i] = n[other] n[other] = temp } }
func reverse(n []int) { for n / 2 раз }
Думаете O(log n)? Казалось бы да, но нет.
Ответ: O(n/2), т.к. мы просто один раз берем половину элементов массива и итерируем их, скажем было 100 элементов взяли половину - 50, для Big O это все те же n элементов, следовательно сложность алгоритма O(n)
The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers. Each account can create up to 10 public channels How to create a business channel on Telegram? (Tutorial) Write your hashtags in the language of your target audience. During the meeting with TSE Minister Edson Fachin, Perekopsky also mentioned the TSE channel on the platform as one of the firm's key success stories. Launched as part of the company's commitments to tackle the spread of fake news in Brazil, the verified channel has attracted more than 184,000 members in less than a month.
from us