for any aray to be exactly zigzag,the input elements should be such,that the elements form a zigzag array. Theres nothing wrong with the code,if it gets proper input,itll work perfectly.
class Solution{ public: // Program for zig-zag conversion of array void zigZag(int arr[], int n) { int temp=true; for(int i=0;iarr[i+1]) { swap(arr[i],arr[i+1]); } //temp=true; } else {
Is it secret problem?? Why audio is low..
yes in my laptop infect not getting low sound also he just explaining himself
😂
😂
every geeks for geeks video is like listening the geeks for geeks editorial,what a waste.
This wont work if there are duplicate elements
There are many solution possible and for some array, no solution. The question formulation is wrong.
for any aray to be exactly zigzag,the input elements should be such,that the elements form a zigzag array. Theres nothing wrong with the code,if it gets proper input,itll work perfectly.
Speak in Lower Volume please,I am deaf now after your LOUD volume.
worng code....
wrong*
class Solution{
public:
// Program for zig-zag conversion of array
void zigZag(int arr[], int n)
{
int temp=true;
for(int i=0;iarr[i+1])
{
swap(arr[i],arr[i+1]);
}
//temp=true;
}
else
{
if(arr[i]