Suppose that you have a number x that is greater than 1. Write an algorithm that computes the largest integer k such that 2k is less than or equal to x.

What will be an ideal response?


1. Let k be 0
2. Let check be 1
3. While check < x
3.1. Let k be k+1
3.2. Let check be check*2

Computer Science & Information Technology

You might also like to view...

Outline the procedure for profiling a C/C++ program in LINUX and UNIX.

What will be an ideal response?

Computer Science & Information Technology

If you want to summarize data from multiple places and want to organize the data differently than how it is presented in the separate worksheets, but use the same row and column labels so the consolidated worksheet matches the data, you would use the ________ option

A) consolidate by category B) consolidate by position C) PivotTable report D) consolidate by formula

Computer Science & Information Technology

int foo(int n)               //Line 1{                            //Line 2  if (n == 0)                //Line 3     return 0;               //Line 4  else                       //Line 5     return n + foo(n - 1);  //Line 6}                            //Line 7 Consider the accompanying definition of a recursive function. Which of the statements represents the base case?

A. Statements in Lines 1-6. B. Statements in Lines 3 and 4. C. Statements in Lines 5 and 6. D. Statements in Lines 3, 4, and 5.

Computer Science & Information Technology

Which of the following is NOT a type of server operating system?

A. Microsoft Windows B. Mac OS X C. Adobe Dreamweaver D. Linux

Computer Science & Information Technology