lotrsimp12345 37 Posting Pro in Training

don't forget about the #ifndef

lotrsimp12345 37 Posting Pro in Training

don't do it with a stack you are typing too much...
use recursion very powerful and easy to understand.

WaltP commented: Recursion is RARELY a good option. -2
lotrsimp12345 37 Posting Pro in Training

Please help really confused.

a multilevel index using a b-tree is to be made for a file with 600,000 records. A block contains 1500 bytes, a key is 10 bytes, a pointer is 5 bytes and a data record is 100 bytes.

a)what is the order of the tree?(assume tree node=a disk block)

600000recordsx100 bytes gives me total file size.
So a block would contain 15 records.

According to the definition in my book the order of a b-tree is the maximum number of descendants that a node in the b-tree can have.

b) how many blocks are required to hold the b-tree records at the lowest level.

2^n would give me the number of descendants at the lowest level where n is order of tree?


c)if at most 5000 bytes can be allocated in memory for the in memory portion of the index, what should the order be so that "sufficient" index blocks can be kept in memory

lotrsimp12345 37 Posting Pro in Training

a multilevel index using a B-tree is to be made for a file with 600,000 records. A block contains 1500 bytes, a key is 10 bytes, a pointer is 5 bytes and a data record is 100 bytes.

a)What is the order of the tree?(assume tree node=a disk block)

600000recordsX100 bytes gives me total file size.
So a block would contain 15 records.

According to the definition in my book the order of a B-tree is the maximum number of descendants that a node in the B-tree can have.

b) How many blocks are required to hold the B-tree records at the lowest level.

2^n would give me the number of descendants at the lowest level where n is order of tree?


c)if at most 5000 bytes can be allocated in memory for the in memory portion of the index, what should the order be so that "sufficient" index blocks can be kept in memory

lotrsimp12345 37 Posting Pro in Training

why are you using a structure? Use object oriented programming with classes lot easier and use recursion. May take more time to come up with but it is easier to understand

lotrsimp12345 37 Posting Pro in Training

In early linux systems, inodes were kept together on one part of a disk, while the corresponding data was scattered elsewhere on the disk. Later editions divided disks drives into group of adjacent cylinders called cylinder groups, in which each cylinder group contains inodes and their corresponding data. How does this new organization improve performance?

lotrsimp12345 37 Posting Pro in Training
#include <iostream>
using namespace std;
#include "Interface.h"


void timer::start()
{
    if(! running)
    {
        begin=(unsigned int) clock();
        running=true;
    }
}

void timer::end()
{
    if(running)
    {
        finish=(unsigned int) clock();
        running=false;
    }
}

int timer::elapsed()
{
    if(running)
    {
        return((unsigned int) clock()-begin);
    }
    else
    {
        return finish-begin;
    }
}

int timer::output(unsigned int seconds)
{
    return seconds >= elapsed();
}

It says undefined reference to '_WinMain@16'

Salem commented: 24 posts, and STILL hasn't figured out code tags :( -7