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)
Step-by-step tutorial on desktop: There have been several contributions to the group with members posting voice notes of screaming, yelling, groaning, and wailing in different rhythms and pitches. Calling out the “degenerate” community or the crypto obsessives that engage in high-risk trading, Co-founder of NFT renting protocol Rentable World emiliano.eth shared this group on his Twitter. He wrote: “hey degen, are you stressed? Just let it out all out. Voice only tg channel for screaming”. End-to-end encryption is an important feature in messaging, as it's the first step in protecting users from surveillance. Developing social channels based on exchanging a single message isn’t exactly new, of course. Back in 2014, the “Yo” app was launched with the sole purpose of enabling users to send each other the greeting “Yo.” Co-founder of NFT renting protocol Rentable World emiliano.eth shared the group Tuesday morning on Twitter, calling out the "degenerate" community, or crypto obsessives that engage in high-risk trading.
from us