T
T
Tylen2022-02-02 01:55:04
Programming
Tylen, 2022-02-02 01:55:04

How does memory allocation work?

Hello, how can I understand the task that the program should allocate one O (1) memory unit. They were given the task of writing a program to detect a palindrome, with this condition

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2022-02-02
@Tylen

It is allowed to allocate memory for a certain number of variables, which does not depend on the length of the string. This is a fancy way to prevent you from making a copy of the string, flipping it over and comparing it to the original.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question