UrbanPro
true

Find the best tutors and institutes for BTech Tuition

Find Best BTech Tuition

Please select a Category.

Please select a Locality.

No matching category found.

No matching Locality found.

Outside India?

Search for topics

Learn BTech Computer Science Engineering with Free Lessons & Tips

Ask a Question

Post a Lesson

All

All

Lessons

Discussion

Lesson Posted on 16/11/2020 Tuition/BTech Tuition/BTech Computer Science Engineering

Binary Search Tree in C

Balaji

#include <stdio.h> #include <stdlib.h> struct node { int element; struct node *left; struct node *right; }; struct node *root = NULL; struct node *insert(struct node *root,struct node *newnode) { if(root == NULL) { root = newnode; } else ... read more

#include <stdio.h>

#include <stdlib.h>

 

struct node

{

   int element;

   struct node *left;

   struct node *right;

};

struct node *root = NULL;

 

 

struct node *insert(struct node *root,struct node *newnode)

{

  if(root == NULL)

  {

    root = newnode;

 

  }

  else

  {

    if(newnode->element < root->element)

    {

        if (root->left == NULL)

            root->left = newnode;

        else

           insert(root->left,newnode);

    }

    else if(newnode->element > root->element)

    {

        if(root->right == NULL)

            root->right = newnode;

        else

         insert(root->right,newnode);

    }

    else

        printf("\n\t Element already exists \n\n");

 

  }

return root;

 

}

 

void find(int val,struct node *root)

{

 

 

   if(root == NULL)

    printf("\n\n\t\tElement not found");

   else

   {

     if(val<root->element)

        find(val,root->left);

     else if(val>root->element)

        find(val,root->right);

     else

        printf("\n\n\tElement Found");

    }

}

 

 

void preorder(struct node *root)

{

  if(root != NULL)

  {

   printf("%d --> ",root->element);

   preorder(root->left);

   preorder(root->right);

  }

}

 

void inorder(struct node *root)

{

 

  if(root!= NULL)

  {

    inorder(root->left);

    printf("%d --> ",root->element);

    inorder(root->right);

  }

}

 

void postorder(struct node *root)

{

  if(root != NULL)

  {

    postorder(root->left);

    postorder(root->right);

    printf("%d --> ",root->element);

   }

}

 

int main()

{

 

  int ch,val;

  struct node *newnode;

 

 

  do

  {

    printf("\n\n\t\t  Binary Search Tree \n");

    printf("\n\t<1> Insertion");

    printf("\n\t<2> Traversal Techniques");

    printf("\n\t<3> Search");

    printf("\n\t<4> Exit");

    printf("\n\t    Enter Your Choice:  ");

    scanf("%d",&ch);

    switch(ch)

    {

        case 1:

               printf("\n\n\tInserting Element : ");

               scanf("%d",&val);

               newnode = (struct node *)malloc(sizeof(struct node));

               newnode->element = val;

               newnode->left = NULL;

               newnode->right = NULL;

 

               root = insert(root,newnode);

               printf("\n\n\tInorder :   ");

               inorder(root);

               break;

        case 2:

              if(root == NULL)

                       printf("\n\tEmpty tree ");

              else

              {

 

               printf("\n\n\tInorder Traversal : ");

               inorder(root);

 

               printf("\n\n\tPreorder Traversal : ");

               preorder(root);

 

               printf("\n\n\tPostorder Traversal : ");

               postorder(root);

              }

               break;

        case 3:

               printf("\n\n\tSearch Element : ");

               scanf("%d",&val);

               find(val,root);

               break;

        case 4:exit(0);

        default: printf("\n\t Invalid Choice\n\n");

                 break;

       }

      }while(ch!= 4);

    return 0;

}

 

read less
Comments
Dislike Bookmark

Lesson Posted on 16/11/2020 Tuition/BTech Tuition/BTech Computer Science Engineering

Circular Queue

Balaji

#include <stdio.h> #include <stdlib.h> #define MAX 5 char a; int front = 0, rear = -1, count = 0; void insert() { char item; if(count==MAX) { printf("\n\t\tCircular Queue Overflow"); return; } else { printf("\n\t Enter the Element: "); scanf("%s",&item); ... read more

#include <stdio.h>

#include <stdlib.h>

#define MAX 5

char a[MAX];

int front = 0, rear = -1, count = 0;

 

void insert()

{

  char item;

if(count==MAX)

{

   printf("\n\t\tCircular Queue Overflow");

   return;

   }

   else

   {

   printf("\n\t Enter the Element: ");

   scanf("%s",&item);

   rear=(rear+1)%MAX;

   a[rear] = item;

   count = count + 1;

   }

   }

 

   void del()

   {

   char item;

   if(count == 0)

   {

      printf("\n\t\tCircular Queue Underflow");

      return;

    }

   else

   {

   item = a[front];

   front = (front+1)%MAX;

   count = count - 1;

   printf("\n\tDeleted Item = %c",item);

   }

   }

 

 

   void display()

   {

   int i,j=front;

   if(count == 0)

     {

     printf("\n\t\tCircular Queue is Empty");

     return;

     }

   else

   {

   printf("\n\tFront = %d  Rear = %d  Count = %d\n",front,rear,count);

   printf("\n\tCircular Queue Elements are: \n\n");

    for(i=1;i<=count;i++)

   {

     printf("\t%d",j);

     j = (j+1)%MAX;

     }

   printf("\n");

   j = front;

   for(i=1;i<=count;i++)

   {

     printf("\t%c",a[j]);

     j = (j+1)%MAX;

     }

     }

     }

 

     int main()

     {

     int ch;

     do

     {

     printf("\n\n\t\tCircular Queue\n\n");

     printf("\t<1> Insert\n");

     printf("\t<2> Delete\n");

     printf("\t<3> Display\n");

     printf("\t<4> Exit\n\n");

     printf("\t    Enter Your Choice: ");

     scanf("%d",&ch);

     switch(ch)

     {

     case 1: insert();

             display();

             break;

 

     case 2: del();

             display();

             break;

     case 3: display();

             break;

     case 4: exit(0);

 

     default: printf("\n\tInvalid Choice")                          ;

              break;

     }

     } while(ch!=5);

     return 0;

read less
Comments
Dislike Bookmark

Lesson Posted on 02/08/2020 Tuition/BTech Tuition/BTech 1st Year Engineering Tuition/BCA Tuition/C Language Programming Tuition/BCA Tuition +1 Tuition/BTech Tuition/BTech Computer Science Engineering less

C program for Beginners

Parul Rajput

I am an assistant professor in computer science & engineering department since 2015. I am completed m.Tech...

A Program to print 2 integer value. #include<stdio.h> #include<conio.h> main() int a,b,add; a=5; b=3; add=a+b; printf(“ Addition=%d”,&add); getch(); Brief description of above program, #include: it includes library function/import predefine libraries. <stdio.h>:... read more

A Program to print 2 integer value. 

#include<stdio.h>

#include<conio.h>

main()

int a,b,add;

a=5;

b=3;

add=a+b;

printf(“ Addition=%d”,&add);

getch();

 

Brief description of above program,

#include: it  includes library function/import predefine libraries.

<stdio.h>:  standard input output header file.

main():  it is first function of C programming. Every C programme must have main() function.

int a,b,add: a,b,add are declared as integer(int) type variables.

add=a+b: this statement sum a and b and store result in add variable.

printf: printf is a function to print output.

getch(): also a function, it is used to return program window to console.

read less
Comments
Dislike Bookmark

Looking for BTech Tuition

Find best BTech Tuition in your locality on UrbanPro.

FIND NOW

Lesson Posted on 06/03/2020 Tuition/BCA Tuition/C Language Programming Tuition/BTech Tuition/BTech Computer Science Engineering Tuition/BTech Tuition/BTech 1st Year Engineering +2 Tuition/BTech Tuition IT Courses/Computer Course/Software Programming less

Compiling C program on Linux machine GCC ,GDB

Narasimha

Linux have powerful tool called "Terminal". From "terminal" we can command the machine. For any programming language the required tools are editor, compiler and debugger. Compiler will check the syntax errors and debugger is helpful while debugging/tracing the problem in source code. The most popular... read more

Linux have powerful tool called "Terminal".

From "terminal" we can command the machine. 

For any programming language the required tools are editor, compiler and debugger.

Compiler will check the syntax errors and debugger is helpful while debugging/tracing the problem in source code.

The most popular tools in Linux for the above-mentioned are

1)vim - editor (for writing c source code)

2)GCC - compiler ( for compiling c file)

3) GDB - debugger ( tracing the issues in code)

 

Below are the command for installing these tools

$ sudo apt-get install vim

$sudo apt-get install gcc

$ sudo apt-get install gdb

 

 

 

read less
Comments
Dislike Bookmark

Answered on 08/11/2019 Tuition/BTech Tuition/BTech Computer Science Engineering IT Courses/Programming Languages IT Courses/Programming Languages/Python

Abraham Paul

Computer Science Teacher & Educational Coach

Yes, you can get a job in the IT industry if and only if you improve your skillset and get yourself updated with the latest technologies in the sectors. In the present scenario, most companies look for candidates with excellent skills in programming and degree is just used as an entry barrier for selection... read more

Yes, you can get a job in the IT industry if and only if you improve your skillset and get yourself updated with the latest technologies in the sectors.  
In the present scenario, most companies look for candidates with excellent skills in programming and degree is just used as an entry barrier for selection from one round to another in interviews.
I would advise you to choose the area in computer science in which you are interested in working on and then learn all the skills by yourself with the help of online resources. It will help you save energy, time and money. I wish you all the best in your career.

read less
Answers 12 Comments
Dislike Bookmark

Answered on 03/11/2019 Tuition/BTech Tuition/BTech Computer Science Engineering

Abraham Paul

Computer Science Teacher & Educational Coach

You can expect to get a minimum of Rs 700 per hour for teaching Database Management Systems (DBMS) for engineering students. How much you should wait depends highly on your educational credentials and experience level. All the best.
Answers 7 Comments
Dislike Bookmark

Answered on 23/08/2017 Tuition/BTech Tuition/BTech Computer Science Engineering

C L Kumar

Maths Tutor

hii saivamsi....start solving aptitude problems and learn c languages ,java,data structure and DBMS.you will surely get placed .thanks
Answers 17 Comments 2
Dislike Bookmark

Answered on 07/11/2019 Tuition/BTech Tuition Tuition/BTech Tuition/BTech Computer Science Engineering

Abraham Paul

Computer Science Teacher & Educational Coach

You should develop the following skills in the computer science field:1) Be an expert in at least 1 programming language2) Develop good problem-solving skills3) Be excellent in Data Structures and Algorithms4) Develop good communication skills5) Develop impactful projects on your own.6) Practice programming... read more

You should develop the following skills in the computer science field:
1) Be an expert in at least 1 programming language
2) Develop good problem-solving skills
3) Be excellent in Data Structures and Algorithms
4) Develop good communication skills
5) Develop impactful projects on your own.
6) Practice programming for at least 1 hour every single day.
7) Participate in online programming competitions and hackathons.
All the bes

read less
Answers 56 Comments 1
Dislike Bookmark

Answered on 22/03/2017 Tuition/BCA Tuition/Computer Architecture Tuition/BSc Tuition/BSc Computer Science Tuition/BTech Tuition +1 Tuition/BTech Tuition/BTech Computer Science Engineering less

Kousalya Pappu

Tutor

Just register yourself on UrbanPro.
Answers 38 Comments 1
Dislike Bookmark

Looking for BTech Tuition

Find best BTech Tuition in your locality on UrbanPro.

FIND NOW

Answered on 15/11/2019 Tuition/BTech Tuition Tuition/BTech Tuition/BTech Computer Science Engineering

Abraham Paul

Computer Science Teacher & Educational Coach

It is always good to do masters in Canada after doing your B.Tech in CSE from CCET Chandigarh.Reason:The cost of education is much cheaper in Canada compared with that of US universities.You will get good academic and cultural exposure in Canada.You will be able to make academic connections with people... read more

It is always good to do masters in Canada after doing your B.Tech in CSE from CCET Chandigarh.
Reason:
The cost of education is much cheaper in Canada compared with that of US universities.
You will get good academic and cultural exposure in Canada.
You will be able to make academic connections with people which will be fruitful in the long run.
You will know how to work with different types of people.
You will be able to land a high paying job if you prove your worth of MS degree to the employers.
You can settle in Canada easily and become a permanent resident of Canada.
Choose your decision based on your career goals.

read less
Answers 25 Comments
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best BTech Tuition in India. Post Your Requirement today and get connected.

Overview

Questions 17

Lessons 37

Total Shares  

+ Follow 98,274 Followers

Related Topics

Top Contributors

Connect with Expert Tutors & Institutes for BTech Computer Science Engineering

x

Ask a Question

Please enter your Question

Please select a Tag

X

Looking for BTech Tuition Classes?

Find best tutors for BTech Tuition Classes by posting a requirement.

  • Post a learning requirement
  • Get customized responses
  • Compare and select the best

Looking for BTech Tuition Classes?

Find best BTech Tuition Classes in your locality on UrbanPro

Post your learning requirement

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more