Answered Questions

  • Time Complexity of Adding Three Matrices

    What is the time complexity of adding three matrices of size NXN cell-by-cell?

    Manish Yadav

    • Oct 15th, 2011

    Time Complexity of Adding Three Matrices because there is only two loop are needed for adding the matrix so complexity will be o(n^2), there is no effect for increase the number of matrix. it will be same for n number of matrix.

    Code
    1. algo like this.......
    2.  
    3. for(i=0;i<n;i++)
    4. {
    5.  for(j=0;j<n;j++)
    6.  {
    7.    result[i][j]=a[i][j]+b[i][j]+c[i][j]+...........................z[i][j];
    8.  }
    9. }
    10.  

    sonia_mehta

    • Jul 6th, 2010

    Program looks like......for(i=0;i<n;i++){ for(j=0;j<n;j++) {   result[i][j]=a[i][j]+b[i][j]+c[i][j]; }}loop will execute n*n times...and 2 add operations..if 1 add op takes 'c' time, thentotal time= 2*c*n*nthus, time complexity= n*n......

  • Deletions at Both the Ends

    Identify the data structure which allows deletions at both ends of the list but insertion at only one end.a. Input-restricted dequeb. Output-restricted dequec. Priority queuesd. None of above

    Shilpa chavare

    • Sep 12th, 2011

    Your qtn itself has the answer.. wen insertion is restricted to one end, then it obviously has to be input restricted dequeue..:)

  • What are the different Abstract Data Type Groups?

    Skill/Topic: Memory, Abstract Data Types, and AddressesA) Integer, Floating-Type, Character & Boolean are the four different data type groupsExplanation: You determine the amount of memory to reserve by determining the appropriate abstract data type group to use and then deciding which abstract data type within the group is right for the data. The different abstract data type groups are Integer, Floating-Type,...