InsertNum(int num,int position){} Write two method bodies of above method (method overloading). Definition: 1. In case of unsorted array first method body will place the user entered number at the desired position of the array in constant time. BigO(1) 2. In case of sorted array second method definition will be called by main() automatically where it needs to be checked if after inserting the element the order of array will not disturb. If the order will disturb the method prompts the user that by doing so order of array will disturb, would you want to continue or terminate? If the user wants to continue then number will be placed at desired position of array otherwise the program will terminate. Use method overloading please and don't use pointers. (Code in C++) Thanks in advance..
InsertNum(int num,int position){}
Write two method bodies of above method (method overloading).
Definition:
1. In case of unsorted array first method body will place the user entered number at the desired position of the array in constant time. BigO(1)
2. In case of sorted array second method definition will be called by main() automatically where it needs to be checked if after inserting the element the order of array will not disturb. If the order will disturb the method prompts the user that by doing so order of array will disturb, would you want to continue or terminate?
If the user wants to continue then number will be placed at desired position of array otherwise the program will terminate.
Use method overloading please and don't use pointers. (Code in C++)
Thanks in advance..
Step by step
Solved in 2 steps with 1 images