11What is the output of the following code?a = [1, 2, 3, 4, 5] k = 2 print(a[-k:] + a[:-k])A[4, 5, 1, 2, 3]B[1, 2, 3, 4, 5]C[5, 4, 3, 2, 1]D[3, 4, 5, 1, 2]View AnswerDiscussWorkspaceReportSaveMedium
12Inserting an element at the beginning of an array of n elements takes:AO(n)BO(1)CO(n log n)DO(log n)View AnswerDiscussWorkspaceReportSaveEasy
13Which data structure stores elements of the same type in contiguous memory?AGraphBTreeCLinked listDArrayView AnswerDiscussWorkspaceReportSaveEasy
14For a 2-D array stored in column-major order, which elements are adjacent in memory?AElements of the same columnBElements of the same rowCDiagonal elementsDNoneView AnswerDiscussWorkspaceReportSaveEasy
15Rotating an array of n elements by k positions can be done in O(n) time and O(1) space by:AUsing a hash tableBSorting itCReversing parts of the array three timesDBinary searchView AnswerDiscussWorkspaceReportSaveEasy