Submitted Questions

  • Test Case for Sorted Singl Linked List

    Write test case(s) and explanation the same for below program. (1) Assume two sorted singly link lists. Merge them into a one sorted singly link list.struct Node{int data;Node* next};Implement,Node* SortedList(Node* list1, Node* list2); (2) Write test cases for following function, mention your assumption(s) if any:BOOL CopyFiletoString(FILE *hfile, char *str, size filesize);calling the function like...

  • Convert 2D Array

    1. Given an 2D array A[M][N], we are converting it into A[N][M] along with rotating it anti clockwise. What should be the mapping,A[i][j] = A[?][?] (i,j are 0 based indices) example:.............................................4......81...2...3...4..............................3......7.......................======>..........2......6 5...6...7...8..............................1......5 2. Assume two...

  • Recursive Function

    1. Find output for following recursive function :int main(){int i=32242,j=find(i);}int find(int j){if(j){j = j%10 + find(j/10);printf(" %d ",j);}return j;} 2. What is the problem with following code : char* AddnewlinetoString(char *s){char buffer[1024];strcpy(buffer,s);buffer[strlen(s)-1] = 'n';return buffer;}