Question

The main goal of Module 7 is understanding the basic pseudocode structures and the three algorith...

The main goal of Module 7 is understanding the basic pseudocode structures and the three algorithms listed in the objectives: linear search, binary search, and bubble sort. For this discussion, please make observations about one or more of these three algorithms. Here are examples of the kinds of questions your observations might address. What assumption does an algorithm make about the input list of numbers? Which of the two searches is more efficient? What is the purpose of one of the algorithms? You also might make an observation about how an algorithm applies to a list of a certain form.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

What assumption does an algorithm make about the input list of numbers?

The binary search is only possible for the sorted, since after checking the middle/center element, it will bifurcate the arrays into two parts, depending upon the pivot value and then iterate. The linear search doesn't required the sorted array, since it is a term by term comparison

Which of the two searches is more efficient?

The binary search is more efficient to find a particular number rather the linear search. The binary search completes the search operation in O(log n) time, whereas the linear search will take O(n), since it will traverse the complete list.

The binary search will divide the array into two parts, then depending on the pivot, then in each step, the focus array will be divided into n/2.

What is the purpose of one of the algorithms?

The bubble sort helps in sorting the input array from lowest value to highest value. It helps in forming an ascending order list of the input numbers

You also might make an observation about how an algorithm applies to a list of a certain form.

The bubble sort or any sorting of number is required for the binary search to search for an element effectively in O(log n) time

Note - Post any doubts/queries in comments section. Rate the answer positive if found helpful

Add a comment
Know the answer?
Add Answer to:
The main goal of Module 7 is understanding the basic pseudocode structures and the three algorith...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Goal: design and implement a dictionary. implement your dictionary using AVL tree . Problem​: Each entry...

    Goal: design and implement a dictionary. implement your dictionary using AVL tree . Problem​: Each entry in the dictionary is a pair: (word, meaning). Word is a one-word string, meaning can be a string of one or more words (it’s your choice of implementation, you can restrict the meaning to one-word strings). The dictionary is case-insensitive. It means “Book”, “BOOK”, “book” are all the same . Your dictionary application must provide its operations through the following menu (make sure that...

  • Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers...

    Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...

  • program in python Randomness can be used to improve the performance of deterministic algorithms which need...

    program in python Randomness can be used to improve the performance of deterministic algorithms which need to make many choices. Rather than repeatedly making fixed, hard-coded choices, a pseudorandom number generator can be used to make dynamic, unbiased choices. If the benefits of "good" choices outweigh the costs of "bad" choices, a random selection of good and bad choices can improve the performance of an algorithm Let us explore this with the QUICKSELECT algorithm. Discovered by the influential computer science...

  • Summarize the following information in easily way and in simple words as your understanding without missing the keywords. ( the Question will be 25 on this information in final ) MARKETING RESEARCH FO...

    Summarize the following information in easily way and in simple words as your understanding without missing the keywords. ( the Question will be 25 on this information in final ) MARKETING RESEARCH FOR THE NEW VENTURE Information for developing the marketing plan may necessitate conducting some marketing research. Marketing research involves the gathering of data to determine such information as who will buy the product or service, what is the size of the potential market, what price should be charged,...

  • DI Question 2 1.5 pts Which situations allow the client main() in the file my_program.py to access a method name, say f...

    DI Question 2 1.5 pts Which situations allow the client main() in the file my_program.py to access a method name, say func(), alone, as in x-func) without dereferencing it using prepended name like modname.func or x = some object. func () or x-SomeClass.func() O func) is defined in some module, say, "modname.py" and modname is imported into my_program.py using: from modname import func() is an instance method or a class method in a class, say SomeClass, defined in the same...

  • 1. List some of the various communities to which you belong (organizations, work, hobbies, fields of...

    1. List some of the various communities to which you belong (organizations, work, hobbies, fields of expertise, family). Give examples of some of the behavioral and language characteristics particular to each group? For instance, do you speak to your job supervisor in the same way you speak to your child or your best friend? Why might you interact with members of different communities differently?    2.What are some of your past experiences with writing? Please explain what you like and...

  • Recursion and Trees Application – Building a Word Index Make sure you have read and understood...

    Recursion and Trees Application – Building a Word Index Make sure you have read and understood ·         lesson modules week 10 and 11 ·         chapters 9 and 10 of our text ·         module - Lab Homework Requirements before submitting this assignment. Hand in only one program, please. Background: In many applications, the composition of a collection of data items changes over time. Not only are new data items added and existing ones removed, but data items may be duplicated. A list data structure...

  • 1 Overview The goal of this assignment is to help you understand caches better. You are...

    1 Overview The goal of this assignment is to help you understand caches better. You are required to write a cache simulator using the C programming language. The programs have to run on iLab machines. We are providing real program memory traces as input to your cache simulator. The format and structure of the memory traces are described below. We will not give you improperly formatted files. You can assume all your input files will be in proper format as...

  • Mountain Paths (Part 1) Objectives 2d arrays Store Use Nested Loops Parallel data structures (i.e...

    Mountain Paths (Part 1) in C++ Objectives 2d arrays Store Use Nested Loops Parallel data structures (i.e. parallel arrays … called multiple arrays in the zyBook) Transform data Read from files Write to files structs Code Requirements Start with this code: mtnpathstart.zip Do not modify the function signatures provided. Do not #include or #include Program Flow Read the data into a 2D array Find min and max elevation to correspond to darkest and brightest color, respectively Compute the shade of...

  • Entering and Contracting Contracting at Charity Medical Center Charity Medical Center (CMC), a five hundred-bed acute-care...

    Entering and Contracting Contracting at Charity Medical Center Charity Medical Center (CMC), a five hundred-bed acute-care hospital, was part of the Jefferson Hospital Corporation (JHC). JHC, which operated several long-term and acute-care facilities and was sponsored by a large religious organization, had recently been formed and was trying to establish accounting and finance, materials management, and human resources systems to manage and coordinate the different facilities of particular concern to CMC, however, was a market share that had been declining...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT