Domanda Need help with another approach to solve this Python Program

ninjacoder

Utente Iron
10 Novembre 2021
1
1
0
5
Hey,

Hope everyone's keeping well..!

I stumbled upon this problem statement: Write a python program to split array and move the first part to end.

Attchd. the approach i could think of using this python compiler: https://www.interviewbit.com/online-python-compiler/

Would really appreciate help with other approaches, TIA..!
python program to split array and move first part to end.JPG
 
Hey,

Hope everyone's keeping well..!

I stumbled upon this problem statement: Write a python program to split array and move the first part to end.

Attchd. the approach i could think of using this python compiler: https://www.interviewbit.com/online-python-compiler/

Would really appreciate help with other approaches, TIA..!
Visualizza allegato 56882
Yo man!

There are tons of algorithm for sort arrays ... i really suggest you to take a look on it and maybe you can adapt it at your occurrence!

Some of it:
When you talked about "split" arrays, come in my mind the "merge sort" algorithm which is probably really near at what you are looking for. Best approach is to count the size of the array, divide it in half, and read it from the end ... or you may create a 3th array and use it for swap ... you know ... in computer science there are many ways to do the same thing ...

Here more information :3

Best regards,
-H-
 
  • Mi piace
Reazioni: ninjacoder