0

Not Yet Answered # Algorithms in C++...yea, the book :P

Okay, so i got the volume I of Sedgewick's Algorithms in C++ and I'm pretty much lost in the first chapter. I understand all the given examples and such things but the exercises seem impossible. I'm still just starting highschool and the math used there aren't that easy and the problems given aren't explained in the text and there are no given solutions to these problems... anyone knows a good math book i could use to "get it all", or even better, are there any solutions to these problems on the net?

smee++ Discussion Starter gregorynoob 2 Narue 5,707 Discussion Starter gregorynoob 2

0

0

what kind of math are we talking here? what do the symbols look like, example of algorithm, etc. ?

0

one problem for example is like this:

```
int i, j, k, count = 0;
for( i = 0; i < N; i++ )
for( j = 0; j < N; j++ )
for( k = 0; k < N; k++ )
count++;
```

develop an expression of the form c0 + c1*N + c2*N^2 + c3*N^3 that accurately describes the running time of your program...

i get the c things, they are some kind of constants, right? but the operations i see here are N + N^2 + N^3 for the increments of the for loops and N^3 for the count variable increments... so now i get confused...

1

>I understand all the given examples

Really? I still don't understand how some of those examples are expected to work, they're so buggy and poorly written. :icon_rolleyes:

>but the exercises seem impossible

You're pretty much expected to be a graduate student taking higher mathematics courses to do those exercises. Don't worry about them, instead focus on the questions that have you writing code rather than proofs.

>anyone knows a good math book i could use to "get it all"

Look for books on discrete mathematics. That should cover most everything you need for algorithm analysis.

0

wow...narue...that's the answer i was hoping for!!! you made my day! seriously!!!

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"

Here is the sample output that I ...

Hello All ...

Iam Getting An Error With try to excecute the stored procedure .

I have Have Sql database , the stored procedure like so :

```
USE [MPRS]
GO
/****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE ...
```

I don’t want at this stage work on a big separate project as I've already got plenty ...