Technical Questions

Q:

Can RC circuit be used as clock source for 8085?

Answer

Yes, it can be used, if an accurate clock frequency  is not required. also the component cost is low compared to LC or Crystal.

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

0 2281
Q:

Write a c program for merge sort.

Answer

#include
#define MAX 50

void mergeSort(int arr[],int low,int mid,int high);
void partition(int arr[],int low,int high);

int main(){
  
    int merge[MAX],i,n;

    printf("Enter the total number of elements: ");
    scanf("%d",&n);

    printf("Enter the elements which to be sort: ");
    for(i=0;i<n;i++){
         scanf("%d",&merge[i]);
    }

    partition(merge,0,n-1);

    printf("After merge sorting elements are: ");
    for(i=0;i<n;i++){
         printf("%d ",merge[i]);
    }

   return 0;
}

void partition(int arr[],int low,int high){

    int mid;

    if(low<high){
         mid=(low+high)/2;
         partition(arr,low,mid);
         partition(arr,mid+1,high);
         mergeSort(arr,low,mid,high);
    }
}

void mergeSort(int arr[],int low,int mid,int high){

    int i,m,k,l,temp[MAX];

    l=low;
    i=low;
    m=mid+1;

    while((l<=mid)&&(m<=high)){

         if(arr[l]<=arr[m]){
             temp[i]=arr[l];
             l++;
         }
         else{
             temp[i]=arr[m];
             m++;
         }
         i++;
    }

    if(l>mid){
         for(k=m;k<=high;k++){
             temp[i]=arr[k];
             i++;
         }
    }
    else{
         for(k=l;k<=mid;k++){
             temp[i]=arr[k];
             i++;
         }
    }
  
    for(k=low;k<=high;k++){
         arr[k]=temp[k];
    }
}


Sample output:

Enter the total number of elements: 5
Enter the elements which to be sort: 2 5 0 9 1
After merge sorting elements are: 0 1 2 5 9

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2277
Q:

Is the address bus unidirectional?

Answer

The address bus is unidirectional because the address information is always given by the micro processoe  to address a memory location of an input / output devices.

Report Error

View answer Workspace Report Error Discuss

Subject: Hardware

0 2272
Q:

What is SLIP

Answer

It is a very simple protocol used for transmission of IP datagrams across a serial line.

Report Error

View answer Workspace Report Error Discuss

Subject: Networking
Job Role: Network Engineer

1 2261
Q:

What are the different job scheduling in operating systems?

Answer

Scheduling is the activity of the deciding when process will receive the resources they request.


FCS ---> FCSFS stands for First Come First Served. In FCFS the job that has been waiting the longest is served next.


Round Robin Scheduling--->Round Robin scheduling is a scheduling method where each process gets a small quantity of time to run and then it is preempted and the next process gets to run. This is called time-sharing and gives the effect of all the processes running at the same time


Shortest Job First ---> The Shortest job First scheduling algorithm is a nonpreemptive scheduling algorithm that chooses the job that will execute the shortest amount of time.


Priority Scheduling--->Priority scheduling is a scheduling method where at all times the highest priority process is assigned the resource.

Report Error

View answer Workspace Report Error Discuss

0 2260
Q:

What is Executive in Windows NT?

Answer

In Windows NT, executive refers to the operating system code that runs in kernel mode.

Report Error

View answer Workspace Report Error Discuss

1 2258
Q:

Point out the error, ifany, in the followingb code?

typedef struct

{

     int data;

     NODEPTR link;

} *NODEPTR;

 

Answer

A typedef defines a new name for a type, and in simpler cases like the one shown below you can define a new structure type and a typedef for it at the same time.


typedef struct


{


    char name[20];


    int age;


} emp;


However, in the structure defined in this question, there is an error because a typedef declaration cannot be used until it is defined. In the given code fragment the typedef declaration is not yet defined at he point where the link field is declared.

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 2253
Q:

What is IGP?

Answer

It is any routing protocol used within an autonomous system.

Report Error

View answer Workspace Report Error Discuss

Subject: Networking
Job Role: Network Engineer

0 2253