✅ C++|| PYTHON || 2 METHODS || DETAILED EXPLAINATION || O(N)
PLEASE UPVOTE IF YOU FIND MY APPROACH HELPFUL, MEANS A LOT \uD83D\uDE0A\n\nIntuition: We return the middle node to get the desired output.\n\nApproach:\n Case1 
**PLEASE UPVOTE IF YOU FIND MY APPROACH HELPFUL, MEANS A LOT \uD83D\uDE0A**\n\n**Intuition:** We return the middle node to get the desired output.\n\n**Approach:**\n* Case1 : We take out the middle of size by checking size is even or odd, then iterate till moddle\n* Case2 : We use slow-fast pointer approach where when fast reaches the end, slow will be at the middle\n\n\n**C++ Solution:**\n```\n// CASE1\nclass Solution {\npublic:\n    ListNode* middleNode(ListNode* head) {\n        int n = 0;\n        ListNode* temp = head;\n        \n        while(temp->next!=NULL)\n        {\n            temp = temp->next;\n            n++;\n        }\n        \n        int mid = (n%2==0) ? (n/2) : (n/2+1);\n        \n        ListNode* node = head;\n        int i = 0;\n        while(i<mid)\n        {\n            node = node->next;\n            i++;\n        }\n        \n        return node;\n    }\n};\n```\n\n```\n// CASE2\nclass Solution {\npublic:\n    ListNode* middleNode(ListNode* head) {\n        ListNode* slow = head;\n        ListNode* fast = head;\n        \n        while(fast!=NULL && fast->next!=NULL)\n        {\n            slow = slow->next;\n            fast = fast->next->next;\n        }\n        \n        return slow;\n    }\n};\n```\n**Python Solution:**\n```\nclass Solution(object):\n    def middleNode(self, head):\n        # We need two pointers, one is head with one step each iteration, and the other is tmp with two steps each iteration.\n        temp = head\n        while temp and temp.next:\n            # In each iteration, we move head one node forward and we move temp two nodes forward...\n            head = head.next\n            temp = temp.next.next\n        # When temp reaches the last node, head will be exactly at the middle point...\n        return head\n```\n**Time Complexity :** `O(N)`\n**Space Complexity :** `O(1)`\n\n![image](https://assets.leetcode.com/users/images/bb1d770c-f789-4e02-95d0-610d06aca0c2_1670206761.8881671.png)\n\n![image](https://assets.leetcode.com/users/images/7a7a686e-8791-43d8-b9b4-75effc98abec_1670206716.58549.png)\n
['C++']