Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- struct Wynik
- {
- string miejsce;
- double czas;
- Wynik* next; // wskaznik na n a s t e p n y wynik
- };
- struct Zawodnik
- {
- string imie, nazwisko;
- Wynik* wyniki; // wskaznik na dr z ewo wynikow
- Zawodnik* lewy;
- Zawodnik* prawy;// l ewy i prawy potomek w d r z ewi e
- };
- int main()
- {
- return 0;
- }
- Zawodnik* Znajdz(string &imieZ, string &nazwiskoZ, Zawodnik* pRoot)
- {
- if (!pRoot)
- {
- pRoot = new Zawodnik{ imieZ,nazwiskoZ, 0, 0, 0};
- return pRoot;
- }
- else
- {
- if (pRoot->imie == imieZ && pRoot->nazwisko == nazwiskoZ)
- {
- return pRoot;
- }
- else if (pRoot->imie > imieZ)
- {
- Znajdz(imieZ, nazwiskoZ, pRoot->lewy);
- }
- else
- {
- Znajdz(imieZ, nazwiskoZ, pRoot->prawy);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement