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
Step-by-step 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
if (A[i] != A[0] and A[i] < A[0]):
L.append(A[i])
This populates list G using the stated condition
if (A[i] != A[0] and A[i] > A[0]):
G.append(A[i])
This returns the two lists L and G
return L, G