Skip to main content

Posts

Showing posts from October, 2018

Error :- CannotCreateContainerError: API error (500): devmapper:

Cause :- This error is caused due to less amount of space available in the root partition. Solution :- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html Extending the Linux file system:- Steps to be taken:- Step 1:- Increase the size of the root volume from aws console     1.1 Select the root ebs volume attached to the aws instance     1.2 Click on the ACTION tab , and then click on modify volume   1.3 Increase the root volume size as per the requirements Step 2:- Check the file system of the root volume   2.1 df -h     2.2  file -s /dev/xvda1       2.3  Expand the modified partition (for linux formatted partition)           growpart /dev/xvda 1  2.4 Resize each file system          resize2fs /dev/xvda1 ====================================================================== FOR NVME devices on AWS Step 1:- Modify the size of root volume by using aws console (aws command line) Step 2:-   2.1 Che

Program In C++ to find out the height of binary tree

// Name :- Bakul Gupta // Email-id :- bakulgupta11@gmail.com #include <bits/stdc++.h> using namespace std ; struct Node { int key; Node *left,*right; Node ( int x) { left= NULL ; right= NULL ; key=x; } }; int height (Node *root) { if (root== NULL ) return 0 ; else { int l= height (root-> left ); int r= height (root-> right ); return 1 + max (l,r); } } int main () { Node *root= new Node ( 10 ); root-> left = new Node ( 20 ); root-> right = new Node ( 30 ); root-> left -> left = new Node ( 40 ); root-> left -> right = new Node ( 50 ); cout<< " \n Height of the tree is :- " << height (root)<<endl; return 0 ; }

Program In C++ to find out the preorder,postorder,inorder traversal of tree

Program :- WAP in C++ to find out the preorder,postorder as well as inorder traversal of the binary tree. Solution :- // Name :- Bakul Gupta // Email-id :- bakulgupta11@gmail.com #include <bits/stdc++.h> using namespace std ; struct Node { int key; Node *left,*right; Node ( int x) { left= NULL ; right= NULL ; key=x; } }; void inorder (Node *root) { if (root) { inorder (root-> left ); cout<<root-> key << ' ' ; inorder (root-> right ); } } void preorder (Node *root) { if (root) { cout<<root-> key << ' ' ; preorder (root-> left ); preorder (root-> right ); } } void postorder (Node *root) { if (root) { postorder (root-> left ); postorder (root-> right ); cout<<root-> key << " " ; } } int main () { Node *root= new Node ( 10 ); ro