Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
/* The program accepts matrix like input & prints the 3-tuple representation of it*/
#include
void main()
{
int a[5][5],rows,columns,i,j;
printf("enter the order of the matrix. The order must be less than 5 × 5:\n");
scanf("%d %d",&rows,&columns);
printf("Enter elements of the matrix:\n");
for(i=0;i for(j=0;j { scanf("%d",&a[i][j]); } printf("The 3-tuple representation of any matrix is:\n"); for(i=0;i for(j=0;j { if (a[i][j]!=0) { } Output: printf("%d %d %d\n", (i+1),(j+1),a[i][j]); } } Enter the order of the matrix. The order must be less than 5 × 5: 3 3 Enter the elements of the matrix: 1 2 3 0 1 0 0 0 4 The 3-tuple representation of the matrix is: 1 1 1 1 2 2 1 3 3 2 2 1 3 3 4 Initially the program prompted for the order of the input matrix along a warning that the order must not be greater than 5 × 5. After accepting order, this prompts for the elements of the matrix. After accepting the matrix, this checks each element of the matrix for a non zero. If the element is non zero, then this prints the row number & column number of that element along its value.
for(j=0;j { scanf("%d",&a[i][j]); } printf("The 3-tuple representation of any matrix is:\n"); for(i=0;i for(j=0;j { if (a[i][j]!=0) { } Output: printf("%d %d %d\n", (i+1),(j+1),a[i][j]); } } Enter the order of the matrix. The order must be less than 5 × 5: 3 3 Enter the elements of the matrix: 1 2 3 0 1 0 0 0 4 The 3-tuple representation of the matrix is: 1 1 1 1 2 2 1 3 3 2 2 1 3 3 4 Initially the program prompted for the order of the input matrix along a warning that the order must not be greater than 5 × 5. After accepting order, this prompts for the elements of the matrix. After accepting the matrix, this checks each element of the matrix for a non zero. If the element is non zero, then this prints the row number & column number of that element along its value.
scanf("%d",&a[i][j]);
}
printf("The 3-tuple representation of any matrix is:\n");
for(i=0;i for(j=0;j { if (a[i][j]!=0) { } Output: printf("%d %d %d\n", (i+1),(j+1),a[i][j]); } } Enter the order of the matrix. The order must be less than 5 × 5: 3 3 Enter the elements of the matrix: 1 2 3 0 1 0 0 0 4 The 3-tuple representation of the matrix is: 1 1 1 1 2 2 1 3 3 2 2 1 3 3 4 Initially the program prompted for the order of the input matrix along a warning that the order must not be greater than 5 × 5. After accepting order, this prompts for the elements of the matrix. After accepting the matrix, this checks each element of the matrix for a non zero. If the element is non zero, then this prints the row number & column number of that element along its value.
for(j=0;j { if (a[i][j]!=0) { } Output: printf("%d %d %d\n", (i+1),(j+1),a[i][j]); } } Enter the order of the matrix. The order must be less than 5 × 5: 3 3 Enter the elements of the matrix: 1 2 3 0 1 0 0 0 4 The 3-tuple representation of the matrix is: 1 1 1 1 2 2 1 3 3 2 2 1 3 3 4 Initially the program prompted for the order of the input matrix along a warning that the order must not be greater than 5 × 5. After accepting order, this prompts for the elements of the matrix. After accepting the matrix, this checks each element of the matrix for a non zero. If the element is non zero, then this prints the row number & column number of that element along its value.
if (a[i][j]!=0)
Output:
printf("%d %d %d\n", (i+1),(j+1),a[i][j]);
Enter the order of the matrix. The order must be less than 5 × 5:
3 3
Enter the elements of the matrix:
1 2 3
0 1 0
0 0 4
The 3-tuple representation of the matrix is:
1
2
3
4
Initially the program prompted for the order of the input matrix along a warning that the order must not be greater than 5 × 5. After accepting order, this prompts for the elements of the matrix. After accepting the matrix, this checks each element of the matrix for a non zero. If the element is non zero, then this prints the row number & column number of that element along its value.
How do collisions happen during hashing? Usually the key space is much larger than the address space, thus, many keys are mapped to the same address. Assume that two keys K1 an
Demonstrate that Dijkstra's algorithm does not necessarily work if some of the costs are negative by finding a digraph with negative costs (but no negative cost dicircuits) for whi
Define data model? A data model is a collection of conceptual tools for explaning data, data relationships, data semantics and consistency constraints.
Q. Describe the term hashing. Explain any two usually used hash functions. Explain one method of collision resolution.
Q. Implement a stack making use of the linked list. Show the PUSH and POP operations both. A n s . Stack implemantation using linked list # include # include
Write an algorithm in the form of a flowchart that: inputs top speeds (in km/hr.) of 5000 cars Outputs fastest speed and the slowest speed Outputs average (mean) s
In this unit, we have learned how the stacks are implemented using arrays and using liked list. Also, the advantages and disadvantages of using these two schemes were discussed. Fo
Q. Make the 11 item hash table resulting from hashing the given keys: 12, 44, 13, 88, 23, 94, 11, 39, 20, 16 and 5 by making use of the hash function h(i) = (2i+5) mod 11.
Graph terminologies : Adjacent vertices: Two vertices a & b are said to be adjacent if there is an edge connecting a & b. For instance, in given Figure, vertices 5 & 4 are adj
Read the scenario (Pickerings Properties). (a) List the functions of the system, as perceived by an external user. (b) List the external entities. Note that because we are mo
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd