Category "space-complexity"

Time and Space complexity of this checking if string is palindrome

I want to verify my assumptions about Time and Space complexity of two different implementations of valid palindrome functions in JavaScript. In the first imple

Time and space complexity - for loop inside of while loop

What is the time & complexity of the code below? function SortFunction (entries): sorted_entries = {} while entries is not empty: smal

Time and Space complexity of the max disk space

from collections import deque def findMax(hardDiskSpace, k): n = len(hardDiskSpace) if n * k == 0: return [] if k > n: return []

Constant space, one pass, daily coding problem

This is the Daily Coding Problem: “Given a singly linked list and an integer k, remove the kth last element from the list. k is guaranteed to be smaller