Assignment help for Algorithm and Complexity

Could I please have this assignment completed (coding-related) in a detailed pseudocode and Python code?

All non-coding related, please have it answered as detailed and clear as possible.

Would be happy to provide the lecture notes if needed.

Please ensure work are plagiarism-free.