Algorithm Design: Best Way to Represent a 2D Grid, with Boundary Digits, in C++?

I like working on algorithms in my spare time to improve my algorithm design skills. I tackle Jane Street’s monthly puzzles as my ‘monthly challenge’. I’ve previously developed algorithms to solve their October Puzzle, and have solved their November puzzle by hand. I solved their November puzzle (Hooks #6) by hand, but only because I’m…

Is there any difference in time complexities of declaring, instantiating and initializing an array in the following methods in JAVA?

I am following an online course about data structures and algorithms. In that course, the instructor tells that the time complexities of following ways are different. Method 1: Declare: int arr[]————>O(1) Instantiation: arr = new int[size]——>O(1) Initialization: arr[0]=0;————>O(1) ————–>O(n) arr[1]=1;————>O(1) Method 2: Declaration,instantiation and initialization: int arr[]={10,20,30}—————->O(1) I need to know that by following the…

Is pulseaudio’s default nice value (-11) actually ineffective due to autogroup?

The pulseaudio daemon runs with nice level -11 by default, via rtkit. However, I’m noticing choppy audio at times of high cpu load, and decreasing the nice value even further by setting high-priority = yes and nice-level = -16 in /etc/pulse/daemon.conf has no effect. realtime-scheduling = yes and realtime-priority = 6, in turn, also appear…