Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1.Describe an algorithm using pseudocode as discussed in class that takes a list of n integers a1, a2, ..., an, and returns a count of

1.Describe an algorithm using pseudocode as discussed in class that takes a list of n integers a1, a2, ..., an, and returns a count of the number of even integers. You can assume that we have a function called IsEven() that takes a value as an argument and returns true if the value is even.Be sure to initialize the variables.

2. The bubble sort algorithm discussed in class is used to sort the following sequence of integers: 13 26 7 31 13 28How many passes must the algorithm perform to guarantee the entire sequence is sorted?What is the list obtained after the first pass?What is the list obtained after the third pass?What is the list obtained after the final pass?

3. Show how the binary search algorithm discussed in class searches for 25 in the sorted listbelow: 2 3 4 9 18 20 24 33 34 45

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions