Solved

Confused on Homework Questions

Posted on 2004-10-02
8
210 Views
Last Modified: 2010-04-01
I am looking for conceptual step-by-step formulas and data that will allow me to do these homework questions below.

I have had bits of good information and realize that this is not a math forum but would appreciat some good ideas in the right direction in addition to,...and of course I am not asking for the problems to be solved.

Please advise.
 -------------------------------------------------------------------------------------------------------------------------------------------
PART II.
Answer the following questions in a text file or turn in a hard copy.

1. Assume you have an input stream '1 2 3 4 5 6' reading from left to right. By using (1) a queue and (2) a deque, which of the following rearrangements can be obtained for output, reading from left-to-right?

a)  1 2 3 4 5 6           b) 2 4 3 6 5 1         c) 1 5 2 4 3 6
d)  4 2 1 3 5 6           e) 1 2 6 4 5 3         f) 5 2 6 3 4 1

2. Compute log2 1000 if all you know is log2 10. Show your work and justify why it is correct.

3. Show how logs "turn" multiplication into addition, division into subtraction, and exponentiation into multiplication.

4. A fully populated binary tree has all nodes (vertices) present. Assuming a tree with one node has height 1, what is the height of a fully populated tree with n nodes? A well-behaved binary tree may not have all levels fully populated, but all leaves in the tree will be on the same or on adjacent levels. What is the height of a well-behaved binary tree with n nodes? (hint: use the floor or ceil function from the math library.)


 


0
Comment
Question by:edelossantos
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 36

Assisted Solution

by:Zyloch
Zyloch earned 250 total points
ID: 12209602
Hi edelossantos,

Not too good at these things, but I can help with the log question.

A rule of logarithms is this:
logb(x^n) = n*logb(x).

For example,

log7 25 = 2*log7 5

Regards,
Zyloch
0
 

Author Comment

by:edelossantos
ID: 12209607
Thank you, Zyloch.  Del
0
 
LVL 36

Assisted Solution

by:Zyloch
Zyloch earned 250 total points
ID: 12209694
For #3, well, go to Google and search Logarithm Rules :)
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 11

Accepted Solution

by:
bcladd earned 250 total points
ID: 12209802
On 4: How many nodes are there in a fully-populated tree of height 1? 2? 3? If you draw pictures, you can answer these questions. If you need to, draw the picture for 4 as well. Then, having written the simple funciton table:

   height | nodes
   -----------------
      1     |  ?
      2     |  ?
      3     |  ?

you should see a pattern. If you have the table and you don't see a pattern, post the table and maybe we can help you find the pattern.

Once you have that information, you will actually have bounds on the height of a well-behaved tree (a well-behaved tree is one that starts with a fully-populated tree and expands it with some number of new leaves from the leaves of the fully-populated tree...so your function of nodes to height (reverse of the table, actually) shows you how to figure out the height of a well-behaved tree.

On 1: Focus on queue: What order will items reach the front of the queue if you enqueue all of them before dequeuing any of them? Can the interleaving of enqueue and dequeue operations change that order? How?

-bcl
0
 
LVL 20

Expert Comment

by:ikework
ID: 12211300
once more:
edelossantos, this side is not made to make your homework, it wouldn't help you understand the thinks you need
to understand, if anybody else but you makes it.
DON'T post here your homework-questions!!! how should your teacher see, what you are able to do,
and what you're not able to do. better ask your teacher once more and discuss the questions with her/him, so
he/she knows which steps need to be repeated in your lesson. i think that's what homework is for


0
 
LVL 20

Expert Comment

by:ikework
ID: 12211378
btw: lots of points(500) & money for homework, better use it for good books ;)
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 12212479
Well, that's true. Of course, we would be inclined to help if you DO post your homework :-)
0
 

Author Comment

by:edelossantos
ID: 12213361
Ikework,
    Again,...I don't mind paying for knowledge...I come to you all to learn if you are willing to teach.  I have bought the books and do not buy the homework.  I will post my own work and if you don't mind...you can check it if for me.  I will comply with all of the experts per the member agreement...most of the time experts refrain from homework questions. I did not think that lots of points would be offensive nor a lack of respect...I think I will post lower points the next time. Thanks again.  Regards.  Del
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 128
Would like to move button in a function 3 79
GUI: DIalog Stacking and Popping in MS C++ 4 82
Where are the c++ header files to use in Eclipse? 4 24
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question