is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
#sort by swapping approach
- rajuby2 July 30, 2020import numpy as np
N= 40
giv_arr = ["a"+str(i) for i in range(1,N+1)] + ["b"+str(i) for i in range(1,N+1)]
print(giv_arr)
def swap(X,Y):
X,Y = Y,X
def check_is_leser(X,Y):
x = int(X[1:])
y = int(Y[1:])
return x < y
def sort_swapmiddle(A):
#get the mid point
N = len(A)//2
#Check if swap happened
swapped = True
itr = 0
#Only when swap happened else stop
while swapped:
#mark as not swapped
swapped = False
#initialize index
L = N-1 #end of first array
R = N #start of second array
i = 0 #iteration counter
if check_is_leser(A[R],A[L]): #only one swap for the edge of the arrays
A[L],A[R] = A[R],A[L]
swapped = True
itr += 1
while check_is_leser(A[L-i],A[L-i-1]): #Track only left array , break when the minimum is reached.
swapped = True
itr += 1
#Swap the right and left element
A[L-i-1],A[L-i] = A[L-i],A[L-i-1]
A[R+i],A[R+i+1] = A[R+i+1], A[R+i]
i += 1
print(itr)
return A
print(sort_swapmiddle(giv_arr))