Tuesday 28 March 2017

Binary Tree (calculate height) Hacker Rank (software engineer interv. 1)

Binary tree is a famous data structure widely used in  problem  solving and i will show class include insert function and calculate max depth of tree


       

 
#include<iostream>
#include<stdio.h>
using namespace std;
class Node
{
    public:
    int data;
    Node* left;
    Node*right;
    Node(int i)
   {
      data = i ;
      right = NULL;
      left = NULL;
   }
};
class NodeOperation
{
    Node* insert(Node*root,int data)
    {
       if (root==NULL)
        {
            return new Node(data);
        }
          Node *  cur ;
         if(data>=root->right)
           {
                       cur = insert(root->right,data);
                       root->right = cur;
           }
         else
        {
               cur = insert(root->left,data);
               root->left = cur;
        }
             
    }
    int calc_height(Node*root)
    {
       if(root==NULL)
         {
           return 0;
         }
       if(root->right==NULL && root->left)
         {
            return 0;
         }
        int rdepth = calc_height(root->right);  
        int ldepth = calc_height(root->left);
      if(rdepth>ldepth)
        return rdepth+1;
     return ldepth+1;
     
    }
};
int main()
{
   NodeOperation oper;
   cout<<"enter node num :";
  int num = 0;
  cin>>num;
Node *root  = NULL;
   while(num--)
  {
    root =  oper.insert(root,num);
 
  }
cout<<"height of tree"+calc_height(root);.
    return 0;
}


Sunday 5 March 2017

10 Tips to start your IT Career

First IT field has many good tracks and you must take a decision to learn one of it to start at least search for a job junior or experience
 There are  some carrier path related with hard code, many carrier path related with tools and carrier path     related with administration if you look for profit or you look for knowledge and experience or look for both you must take fixed steps to get your goals and also I will state some tips in this article to help anyone to take right decision   
1 -  If your study in computer science field and you write many code from scratch and understand few    algorithms, start in  complex path or carrier at least   2 years then learn at least one of tools
2 -      If your study leak or your study out of computer science  and you didn’t  aware with algorithms and math start your carrier with tools
3 -      If you heat programming at all and you want to shift carrier to IT  try network  field but you must set on your mind  you will pay a lot of money for courses and certification   before you start your job  this is the most filed that need certifications and courses and especially  this field  if any one choose it he should be love it before   
4 -      If  you want to stop from programming after more than one year’s administration field is very good for you  
5 -      Portfolio is most thing that help you to find your carrier quickly
6 -     Open source is very well track and I recommend it  if you are strong in  coding or upgrade your     self  
7 -      Understand Object oriented and write code with it in many business  the only way to increase your experience in coding and carrier path form junior to senior otherwise  search experience and become only suitable for your company only
8 -      Coding with tools especially mobile or web development help you to start your own business  or      make money from freelancer
9 -      If you faced some bad  peoples in work be patient  and also try to learn from them also
10-   If your work only maintains existing your company’s  products  try to  change your  position after you prove yourself in company don’t leave company  at first
Tools mean here anything has  rich resources on internet and many open source libraries that help you in coding like web development front end and back end  ,mobile development  etc.  Hard code here means java, C++, C#, python etc.
The programming languages in DEC order from difficulty to easy

C ,C++,Java, C# , Python  but if you learn java  don’t stop on JavaSE only  learn some tools from javaEE   , C++ is long learning way  and Python is Strong and easier than java and if you have different  case please make comment below  

Oracle requires a subscription to use Java SE NOW

May be licenses won’t be available for Java SE 8 or later, but separate support contracts also go away after Microsoft acquire G ithub...