Site icon Case Study Help

UMUC Convert Python to Java Programming Code

UMUC Convert Python to Java Programming Code

Description

Please convert this python code to JAVA code (just one function):

#Shell Sort Algorithm

def shellSort(data, length):

gap = length//2

while gap > 0:
for iIndex in range(gap, length):

temp = data[iIndex]

jIndex = iIndex

while jIndex >= gap and data[jIndex – gap] > temp:
data[jIndex] = data[jIndex – gap]

jIndex -= gap

data[jIndex] = temp

gap //= 2

print(data)

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version