Convert array into Zig-Zag fashion | GeeksforGeeks

Sdílet
Vložit
  • čas přidán 12. 01. 2017
  • Explanation for the article: www.geeksforgeeks.org/convert-...
    This video is contributed by Harshit Jain.

Komentáře • 13

  • @GaneshKumar-dw8gr
    @GaneshKumar-dw8gr Před 4 lety +32

    Is it secret problem?? Why audio is low..

  • @ShivamKumar-cv7jv
    @ShivamKumar-cv7jv Před 3 lety +5

    every geeks for geeks video is like listening the geeks for geeks editorial,what a waste.

  • @WowPlusWow
    @WowPlusWow Před 3 lety +2

    This wont work if there are duplicate elements

  • @rahulshrivastava3040
    @rahulshrivastava3040 Před 6 lety +5

    There are many solution possible and for some array, no solution. The question formulation is wrong.

    • @sounavapal762
      @sounavapal762 Před 5 lety

      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.

  • @gay-bitchass-nigga3036
    @gay-bitchass-nigga3036 Před 2 lety +2

    Speak in Lower Volume please,I am deaf now after your LOUD volume.

  • @Ajeetsingh-uz4fp
    @Ajeetsingh-uz4fp Před 6 lety +3

    worng code....

  • @wecan2729
    @wecan2729 Před 3 lety

    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]