/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) {} };*/ #include <cstdlib> class Partition { public: ListNode* partition(ListNode* pHead, int x) { ListNode *cur = pHead; ListNode *lessHead, *lessTail, *greaterHead, *grea...