Answer:
In Python:
def split(A):
L=[]; G=[]
for i in range(1,len(A)):
if (A[i] != A[0] and A[i] < A[0]):
L.append(A[i])
if (A[i] != A[0] and A[i] > A[0]):
G.append(A[i])
return L, G
Explanation:
This defines the function
def split(A):
This initializes the L and G lists
L=[]; G=[]
This iterates through the original list A
for i in range(1,len(A)):
This populates list L using the stated condition
<em> if (A[i] != A[0] and A[i] < A[0]):</em>
<em> L.append(A[i])</em>
This populates list G using the stated condition
<em> if (A[i] != A[0] and A[i] > A[0]):</em>
<em> G.append(A[i])</em>
This returns the two lists L and G
return L, G