Apr-20-2017, 02:25 PM
Hello.
I use Python 2.7
What the deference in time and space complexity between using classes and arrays?
I have class A. Class A have not any methods, only container of fields.
And map of instance of class A. Let it be m1.
Also I have array which contains same data as fields of class A
and map m2 with instance of such arrays.
number of instances in m1 and m2 are same and data is same.
My question is:
Which map will takes more memory and working faster m1 or m2? And how much?
In fact my question is:
What work faster and take less memory array or class and if we have huge amount of instances? And how much?
Thank you.
I use Python 2.7
What the deference in time and space complexity between using classes and arrays?
I have class A. Class A have not any methods, only container of fields.
And map of instance of class A. Let it be m1.
Also I have array which contains same data as fields of class A
and map m2 with instance of such arrays.
number of instances in m1 and m2 are same and data is same.
My question is:
Which map will takes more memory and working faster m1 or m2? And how much?
In fact my question is:
What work faster and take less memory array or class and if we have huge amount of instances? And how much?
Thank you.