#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
 
const int min = 2;
const int max = 2*min;
 
struct Item
{
    int cnt; // 1 <= cnt <= max
    string key [max+1]; // 0..cnt-1
    Item* ptr [max+2]; // 0..cnt
    Item ();
};
 
Item::Item ()
{
    cnt = 0;
    for (int i = 0; i < max + 1; i++) key[i] = "";
    for (int i = 0; i < max + 2; i++) ptr[i] = nullptr;
}
 
Item* root = nullptr;
 
bool search (Item * p, string name)
{
    bool result = false;
    while (p != nullptr && ! result)
    {
        int i = 0;
        while (i < p->cnt && p->key[i] < name) i++;
        if (i < p->cnt && p->key[i] == name)
            result = true;
        else
            p = p->ptr[i];
    }
    return true;
}
 
int main ()
{
    /*
    enter (root, "10");
    enter (root, "05");
    enter (root, "20");
    enter (root, "03");
    */
    cout << "Konec programu" << endl;
    system ("pause");
    return 0;
}
 
bstrom_2018_st.txt · Last modified: 2018/03/14 17:12 by 147.32.8.110
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki