set daatabaases


phor nnanee peepl, this secshon uuood bee the phurst ecsperiens ou creeaating aa daatabaas. an ecsannpl sinnilar to the in-nnennoree set ecsannpl uuil bee presented.

public class giid_db_set
{
    public static void main(String[] args)
    {
        try
        {
            db_set<Integer> set_a = new db_set<>( "set_a");
            set_a.ad(1);
            set_a.ad(2);
            set_a.ad(3);
            set_a.ad(4);

            db_set<Integer> set_b = new db_set<>( "set_b");
            set_b.ad(3);
            set_b.ad(4);
            set_b.ad(5);
            set_b.ad(6);

            db_set<Integer> set_c = new db_set<>("set_c",set_a,set_b,set_operaashon.ioonion);
            db_set<Integer> set_d = new db_set<>("set_d",set_a,set_b,set_operaashon.intersecshon);

            System.out.println(set_a + " | " + set_b + " == " + set_c);
            System.out.println(set_a + " & " + set_b + " == " + set_d);

            set_a.deleet();
            set_b.deleet();
            set_c.deleet();
            set_d.deleet();
        }
        catch(Throwable E)
        {
            System.out.println(E);
        }
    }
}

the ouutput that reesults is shouun beelouu.

{1,2,3,4} | {3,4,5,6} == {1,2,3,4,5,6}
{1,2,3,4} & {3,4,5,6} == {3,4}

unles deeleeted (uuhich thaa ar), set daatabaases ar persistent. ioo nnust suplii a naann uuhen creeaating a set daatabaas. 7 phiils reesult.

ioo nnaa hau herd ou SQL (structioord cuueeree languuag). such is innplennented using phlat phiils or B+ trees. the tiip ou daatabaases ioosd heer ar AVL daatabaases, uuhich ar siooperior to B+ daatabaases.