Are creature environmental effects a bubble or column?

I am planning out my campaigns first BBE and am going with an aboleth.

In the rules an aboleth has a number of regional effects that reach up to a mile. This aboleth is currently in an underground pool in a mine about a mile underground. So would the characters see any evidence of the aboleth effects at ground level away from the mine, or would the effects only exist in a bubble the top of which is level with the top of the mine?

To my mind the effects will be a bubble, so widening out from the aboleth, if the approached underground they would meet them far sooner?

Can you summon a spiritual weapon into the bubble created by Bead of Force? Can whoever is inside cast charm person on someone outside the bubble?

The wording for Bead of Force says "Only breathable air can pass through the sphere’s wall. No Attack or other Effect can." which obviously means that spells such as firebolt or ray of sickness could not harm a creature inside. However, what about spells that only require line of sight?

I’ve read the discourse on Wall of Force, which suggests that you would not be able to do such spells, and the wording is similar to Bead of Force.

Bubble Sort: Runtime complexity analysis like Cormen does

I’m trying to analyze Bubble Sort runtime in a method similar to how Cormen does in "Introduction to Algorithms 3rd Ed" for Insertion Sort (shown below). I haven’t found a line by line analysis like Cormen’s analysis of this algorithm online, but only multiplied summations of the outer and inner loops.

For each line of bubblesort(A), I have created the following times run. Appreciate any guidance if this analysis is correct or incorrect. If incorrect, how it should be analyzed. Also, I do not see the best case where $ T(n) = n$ as it appears the inner loop always runs completely. Maybe this is for "optimized bubble" sort, which is not shown here?

Times for each line with constant run time $ c_n$ , where $ n$ is the line number:

Line 1: $ c_1 n$

Line 2: $ c_2 \sum_{j=2}^n j $

Line 3: $ c_3 \sum_{j=2}^n j – 1$

Line 4: $ c_4 \sum_{j=2}^n j – 1$ Worst Case

$ T(n) = c_1 n + c_2 (n(n+1)/2 – 1) + c_3 (n(n-1)/2) + c_4 (n(n-1)/2)$

$ T(n) = c_1 n + c_2 (n^2/2) + c_2 (n/2) – c2 + c_3 (n^2/2) – c_3 (n/2) + c_4 (n^2/2) – c_4 (n/2)$

$ T(n) = (c_2/2+c_3/2+c_4/2) n^2 + (c_1 + c_2/2+c_3/2+c_4/2) n – c_2 $

$ T(n) = an^2 + bn – c$

Bubble Sort from Cormen

Insertion Sort from Cormen

Creating a “bubble” UI layout like used in the Apple Music app

I’ve been thinking about experimenting with a layout like the one used in the Apple Music app on iOS.

The interface is the “bubble” interface that is used to choose your preferences etc…

enter image description here

But I don’t really know where to even start with this. Is there a name for the general idea of creating these sort of semi-physics based layouts?

Would love to know what it is I need to search for in order to learn how these work.

I’d be writing it on iOS in Swift but looking more for the name of this sort of interface so I can learn the principals behind creating it.

Thanks

Recursive Bubble Sort Complexity

I have this code for a recursive bubble sort:

def bubble_sort_recursive(list_):     global counter     for i in range(len(list_)):         counter += 1         try:             if list_[i + 1] < list_[i]:                 list_[i], list_[i + 1] = list_[i + 1], list_[i]                 bubble_sort_recursive(list_)         except IndexError:             continue     return list_ 

The counter is initialized with zero outside the function, so I can count the number of times the elements were iterated.

I was told that the complexity of bubble sort is O(N^2). But when I run with a reversed list (worst case) with size 3, the counter finishes with the value 12, shouldn’t it be 9?

The same happens for other sizes: 4 -> 28 5 -> 55

What is happening?