Application Developer Ques:- Write code to find the middle element of a linked list Asked In :- Dassault Systemes, Intelizign, Agaram InfoTech, Orion Innovation, avaya, defence equipment & support (de&s), syncfusion, redgate software, ntrust infotech, htd, Right Answer:```python class ListNode: def __init__(self, value=0, next=None): self.value = value self.next = next def find_middle(head): slow = head fast = head while fast and fast.next: slow = slow.next fast = fast.next.next return slow.value ``` Show Comments Email Me Answers I also Faced Add to Favorite
Application Developer Ques:- Given a matrix.Write a code to print the transpose of the matrix Asked In :- Principal Global Services, SysTrack Solution, Rheal Software, Sion Semiconductors, Softsuave, Happeo, Coforge, Orion Innovation, syncfusion, skydio, Right Answer:```python def transpose_matrix(matrix): return [[matrix[j][i] for j in range(len(matrix))] for i in range(len(matrix[0]))] # Example usage: matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] transposed = transpose_matrix(matrix) print(transposed) ``` Show Comments Email Me Answers I also Faced Add to Favorite