Posts

Showing posts from October, 2021

Luxsoft Interview questions

 Find the Normal of a square matrix =  Sqrt (sum of squares of all elements of the matrix ) [ 1 2 3] [ 2 3 4] [ 400000 500000 6] [ 1 2 3 2 3 4 4 5 6 ] double find_normal_square_matrix(int arr[][],int num) {   long long sum=0;   int k=0;    for(i=0; i< num*num; i++)    {        int j= i%num;        if(i%num == 0)     { j = 0;   k++; }         temp = arr[k][j];         sum+=(long long)temp*temp;    }    return sqrt(sum); } Write a simple C++ program to delete a node in the single linked list when the pointer to the node is given as input (no other) )with all scenarios considered iferoz@luxoft.com Solution:- copy all the next nodes data to itself and delete the last node void node_del(struct node* ptr) {    if(ptr->next == NULL)    {      free(ptr); return;    }   str...