What is the analysis and complexity of a shell sortalgorithms?

Answers

Answer 1
Answer:

Answer: The shell sort is based on insertion sort. Here the list of elements are divided into smaller sub list which are sorted based on insertion sort.

Its best case time complexity is O(n* logn) and worst case is O(n* log^2 n)

Explanation:

Shell sort is an inplace sorting here we begin by dividing the list into sublist and sorting the list with insertion sort. We create interval for dividing the list into sub list until we reach the smallest interval of 1.

The best case is O(n* logn).


Related Questions

suppose you have to implement an operating system on hardware that supports interrupts and exceptions but does not have an explicit trap (syscall) instruction. Can you devise a satisfactory substitute for traps using interrupts and/or exceptions? If so, explain how. If not, explain why. (In this context, the trap instruction is the instruction used by a user-level process to invoke a system call in the operating system, i.e., the trap instruction is the system call instruction
g Write a line of code to invoke a function named RandNum, which accepts no parameters, and storing the return value in a variable called num (which has already been defined). Separate each item with 1 space (except around the parentheses), and end the line with a semi-colon.
For each of the following algorithms medicate their worst-case running time complexity using Big-Oh notation, and give a brief (3-4 sentences each) summary of the worst-case running time analysis. (a) Construction of a heap of size n , where the keys are not known in advance. (b) Selection-sort on a sequence of size n.(c) Merge-sort on a sequence of size n. (d) Radix sort on a sequence of n integer keys, each in the range of[ 0, (n^3) -1] (e) Find an element in a red-black tree that has n distinct keys.
The function changeLocation is also called a _____.class bike:def __init__(self,size,idNum,color ):self.size = sizeself.location = 10self.color = colorself.idNum = idNumdef changeLocation(self,newLocation):self.location = newLocationmanipulatorinitiatormethodconstructor
An objective function in linearprogramming is a(n):decisionvariable.environmentvariable.resultvariable.independentvariable.constant.

DSL is the abbreviation for?data service line

digital subscriber line

data subscriber line

digital service line

none of the above

Answers

Answer:

digital subscriber line

What are the advantages and disadvantages of using the serial console connection compared to the usb console connection to a cisco router or switch?

Answers

It dеpеnds οn thе pοrt availability οn thе PC and thе rοutеr οr switch. If thе PC has a sеrial pοrt and a DB9-tο-RJ45 cablе is availablе, it is gеnеrally еasiеr tο cοnnеct tο thе rοutеr οr switch using thе sеrial cοnsοlе pοrt. If thе PC dοеs nοt havе a sеrial pοrt, a third party USB-tο-Sеrial adaptеr can bе usеd. Ciscο switchеs dο nοt havе mini-USB cοnsοlе pοrts, sο cοnnеcting via USB is nοt an οptiοn. If cοnnеcting frеquеntly tο a Ciscο rοutеr that has a Mini USB cοnsοlе pοrt, this can bе thе mοst еffеctivе mеthοd οncе thе Ciscο drivеrs arе installеd, bеcausе nеarly all nеwеr PCs havе USB pοrts.

Solution:

The advantages and disadvantages of using the serial console connection compared to the USB console connection to a cisco router or switch Re as follows:

USB stands for Universal Serial Bus. The advantages over serial and parallel connections are several and quite significant. The data transfer rate of a USB port is quite high I don't remember the specifics but it's something like 10MB/sec. Serial ports are significantly slower and while parallel ports are somewhat faster they are still very slow in comparison to a USB port.  The transfer rate is quite miser compared to USB.  

Another great difference is that with serial or parallel devices you must reboot the computer every time you change a device on the port. USB devices are hot-swappable, meaning you can change them out with the computer on, without having to reboot since the system will automatically detect when a device is plugged in (at least this is Micro$oft claims).  

A great advantage is that several devices to a single USB port through a port hub.  

The only disadvantage is in USB devices are limited to a distance of about 7ft from the port. Serial devices can be extended to a much greater distances.

Write a program that asks the user to enter the size of a triangle (an integer from 1 to 50). Display the triangle by writing lines of asterisks. The first line will have one asterisk, the next two, and so on, with each line having one more asterisk than the previous line, up to the number entered by the user. On the next line write one fewer asterisk and continue by decreasing the number of asterisks by 1 for each successive line until only one asterisk is displayed. (Hint: Use nested for loops; the outside loop controls the number of lines to write, and the inside loop controls the number of asterisks to display on a line.) For example, if the user enters 3, the output would be:_______.a. *b. **c. ***d. **e. *

Answers

Answer:

Implemented using Python

n = int(input("Sides: "))

if(n>=1 and n <=50):

    for i in range(1,n+1):

         for j in range(1,i+1):

              print('*',end='')

         print("")

       

    for i in range(n,0,-1):

         for j in range(i,1,-1):

              print('*',end='')

         print("")

else:

         print("Range must be within 1 and 50")

Explanation:

This line prompts user for number of sides

n = int(input("Sides: "))

The line validates user input for 1 to 50

if(n>=1 and n <=50):

The following iteration uses nested loop to print * in ascending order

   for i in range(1,n+1):

         for j in range(1,i+1):

              print('*',end='')

         print("")

The following iteration uses nested loop to print * in descending order        

    for i in range(n,0,-1):

         for j in range(i,1,-1):

              print('*',end='')

         print("")

The following is executed if user input is outside 1 and 50

else:

         print("Range must be within 1 and 50")

Constructing a concurrent server by spawning a process has some advantages and disadvantages compared to multithreaded servers. Discuss a few.

Answers

Answer:

The advantage and the disadvantage of the relevant query are illustrated in the explanation in the paragraph below.

Explanation:

Advantage:

  • The benefit of creating a simultaneous server through spawning a mechanism seems to be that alternative methods are shielded against everyone else, which would be very necessary whenever the extremely database manages communication services entirely.

Disadvantage:

  • The downside about creating a concurrent system through spawning a methodology seems to be that this process seems to be very expensive but using multicore processing systems should save this expense. It is also easier when using threads again for the aim of communicating between two or even more participants although we stop the kernel executing the correspondence.

Why we need each section of prologprogram?

Answers

Answer:

Prolog program are used in the artificial intelligence and the web development in a systematic manner process. As, it is also sometimes known as declarative language which basically consist of some facts and list. Prolog program are divided into the sections that are:

  • Domain sections
  • Clauses sections
  • Predicates sections
  • Goal sections

We need each section of the prolog program because all the sections introduced the systematic program and performed there particular functions so by using all these processing steps an efficient function are formed.

In QlikView, ________ are used to search information anywhere in the document.

Answers

Answer:

Search Object

Explanation:

Qlikview is a form of computer software application that is basically used in analytics explanation. In order to search for information anywhere in the document inside the Qlikview application, a form of sheet object referred to as SEARCH OBJECT is utilized.

Hence, in this case, In QlikView, SEARCH OBJECT is used to search for information anywhere in the document.