If there are two same elements in an array then , do both of them saves the same variable and do both of them occupie same space | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If there are two same elements in an array then , do both of them saves the same variable and do both of them occupie same space

help me solve this

1st Jun 2018, 3:58 PM
Vedanta Singh
Vedanta Singh - avatar
2 Answers
+ 2
so are you saying for example... there is an array var[] array = { 1, 2, 3, 3, 5} are the threes the same. well they are the same number but they have a different position in the array.. var [2] = 3 and var [3] = 3 and they will each have a different address of where they reside .. so the answer is no they do not occupy the same space .. unless I missed something.. as I am still learning
1st Jun 2018, 4:52 PM
laura
0
thank you very much
3rd Jun 2018, 8:27 AM
Vedanta Singh
Vedanta Singh - avatar