SHARE
TWEET

Untitled

a guest Sep 20th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. class OList
  5. {
  6.     public:
  7.         int data;
  8.         OList* lAdress;
  9.         OList* rAdress;
  10.         OList()
  11.         {
  12.             lAdress = nullptr;
  13.             rAdress = nullptr;
  14.             data = 0;
  15.         }
  16.         void add(OList* &tail, int data)
  17.         {
  18.             OList* stepGO = tail;
  19.             OList* temp = new OList;
  20.             if(tail == nullptr)
  21.             {
  22.                 temp->rAdress = nullptr;
  23.                 temp->lAdress = nullptr;
  24.                 temp->data = data;
  25.                 tail = temp;
  26.             }
  27.             while(stepGO->rAdress != nullptr && data > stepGO->data)
  28.                 stepGO = stepGO->rAdress;
  29.             temp->lAdress = stepGO;
  30.             if(stepGO->rAdress != nullptr) (stepGO->rAdress)->lAdress = temp;
  31.             temp->data = data;
  32.             stepGO->rAdress = temp;
  33.         }
  34.         ll removeEl(OList* &tail,int value)
  35.         {
  36.             OList* stepGO = tail;
  37.             while(stepGO->rAdress != nullptr && data != stepGO->data)
  38.                 stepGO = stepGO->rAdress;
  39.             if(stepGO->data != data) return 2147483648;
  40.             else
  41.             {
  42.  
  43.             }
  44.         }
  45.  
  46. };
  47. int main()
  48. {
  49.     OList* a = new OList;
  50.     return 0;
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top