According to computer networking: a top-down approach, the transmission rate of Ethernet LAN is 10 Mbps, 100 Mbps, 1 Gbps and 10 Gbps. Maximum rate can be transmitted to a destination that is not being transmitted to by other users.
How do you do bubble sort in C programming?
Bubble sort, also known as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm gets its name from the way smaller elements "bubble" to the top of the list. Because it only uses comparisons to operate on elements, it is a comparison sort. Although the algorithm is simple, it is not efficient for sorting large lists; other algorithms are better.
Write an Assembly language program to multiply 32 bit numbers?
.data mult1 dw 2521H dw 3206H mult2 dw 0A26H dw 6400H ans dw 0,0,0,0 .code mov ax,@data mov ds,ax ; LEA SI,ans mov ax,mult1 mul mult2 mov ans,ax mov ans+2,dx mov ax,mult1+2 mul mult2 add ans+2,ax adc ans+4,dx adc ans+6,0 mov ax,mult1 mul mult2+2 add ans+2,ax adc ans+4,dx adc ans+6,0 mov ax,mult1+2 mul mult2+2 add ans+4,ax adc ans+6,dx mov ax,4C00h int 21h end
Write a program to insert or delete a node from doubly linked list?
Encoder:- In character recognition, that class of printer which is usually designed for the specific purpose of printing a particular type font in predetermined positions on certain size forms.
(electronics) In an electronic computer, a network or system in which only one input is excited at a time and each input produces a combination of outputs. encoder http://www.answers.com/main/Record2?a=NR&url=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3AEncoder%2520diagram.svg http://www.answers.com/main/Record2?a=NR&url=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3AEncoder%2520diagram.svg Circuit diagram of a single bit 4-to-2 line encoder A3A2 A1 A0 F1 F0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 0 Encoder:- In character recognition, that class of printer which is usually designed for the specific purpose of printing a particular type font in predetermined positions on certain size forms.
(electronics) In an electronic computer, a network or system in which only one input is excited at a time and each input produces a combination of outputs. encoder http://www.answers.com/main/Record2?a=NR&url=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3AEncoder%2520diagram.svg http://www.answers.com/main/Record2?a=NR&url=http%3A%2F%2Fcommons.wikimedia.org%2Fwiki%2FImage%3AEncoder%2520diagram.svg Circuit diagram of a single bit 4-to-2 line encoder A3A2 A1 A0 F1 F0 0 0 0 1 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 0 1 1 Truth table
What are the disadvantages of breadth first search?
takes a lot of time because you will have to go through all the parent nodes before going to the children nodes
How do you print the revers string?
u got a String A
String B stores the reverse
A="John"
use a reverse loop.
for(int i=A.length();i>0;i--)
{
p=A.charAt(i);
B=B+p;
}
thats it u got the reverse in B
In Java, you can just use the build-in method of the class StringBuffer.
1^2 = 1
11^2 = 121
111^2 = 12321
1111^2 = 1234321
11111^2 = 123454321
#include
#include
#include
void main()
{
clrscr(); int n;//soullessgod
cout<<"\n enter number of lines ";//whatsoever
cin>>n;
int a=1,b,s=1;
for(;a<=n;s=s*10+1)
{
for(b=n-a;b>=1;b--)
{
cout<<" ";
}
cout<
a++;
}
getch();
}
What are the data types provided in c language?
C is not an object oriented programming language. As such there are no class data types in C.
You want a algorithm to convert tree to binary tree?
The simplest way to do this is to iterate over your general tree and add each value you find to a new binary tree. The logic of the binary tree will take care of the "conversion" for you.
Note: The problem with this is that your "general" tree might already contain data in sorted order. If this is the case and you're doing an in-order traversal, then you just might be building yourself a worst-case tree.
// answer in C-style pseudo-code
// all division should be rounded up
// search will return the index of the number found, or -1 if it was not found
// nums is the array of numbers we're searching through
// num is the specific number we want to find in nums
// current is the index we are currently inspecting
// start is the first index of nums (typically 0)
// end is the last index of nums (typically the length - 1)
// preconditions: nums must be sorted or function is nondeterministic
int search( int[] nums, int num, int current, int start, int end ) {
if( nums[current] end ) { // target not in list
return -1;
}else if( nums[current] > num ) { // search to the left
return search( nums, num, current - ((current - start)/2), start, current );
}else if( nums[current] < num ) { // search to the right
return search( nums, num, current + ((end - current)/2), current, end );
}
}
// convenience function to start the search
int search( int[] nums, int num ) {
return search(nums, num, (nums.length/2), 0, nums.length - 1);
}
C is not an object-oriented programming language and therefore has no concept of abstract classes.
In C++, however, an abstract class is a base class that declares one or more pure-virtual functions. An abstract base class is also known as an abstract data type (ADT). Pure-virtual functions differ from virtual functions in that virtual functions are expected to be overridden (but needn't be) while a pure-virtual function must be overridden (but needn't be implemented by the ADT). Once overridden by a derived class, the function reverts to being a virtual function with respect to further derivatives. However, only classes that provide or inherit a complete implementation of the pure-virtual interface can be instantiated in their own right; those that do not are themselves abstract data types.
Write a program in C language to convert infix expression to postfix expression?
#
/**************************//**********cReDo**********//*****mchinmay@live.com***///C PROGRAM TO CONVERT GIVEN VALID INFIX EXPRESSION INTO POSTFIX EXPRESSION USING STACKS.#includeWhat is putchar function in c?
putchar used to write one character to output device Example putchar (variable_name); #include<stdio.h> void main() { char alpha='x'; clrscr(); putchar(alpha); putchar('\n'); /*or*/ putchar('\Y'); getch(); }
What the difference between pretest loop and posttest loops?
The difference is that pre means before and post means after in Latin so it's tested before or after. :)
How do you write a program in C language to get the ASCII values of all the letters of the alphabet?
#include<iostream.h>
void main()
{
int x;
char y;
cin>>y;
x=y;
cout<<"ASCII VALUE"<<x;
}
Or rather:
for (c='A'; c<='Z'; ++c) printf ("'%c' %d 0x%x\n", c, c, c);
for (c='a'; c<='z'; ++c) printf ("'%c' %d 0x%x\n", c, c, c);
Explain the various data types available in SQL?
You retrieve, store, and update SQL3 datatypes the same way you do other datatypes. You use either ResultSet. getXXX or CallableStatement. getXXX methods to retrieve them, PreparedStatement. setXXX methods to store them, and updateXXX to update them. Probably 90 percent of the operations performed on SQL3 types involve using the getXXX , setXXX , and updateXXX methods. The following table shows which methods to use:
SQL3 type
getXXX method
setXXX method
updateXXX methodBLOB
getBlob
setBlob
updateBlobCLOB
getClob
setClob
updateClobARRAY
getArray
setArray
updateArrayStructured type
getObject
setObject
updateObjectREF (structured type)
getRef
setRef
updateRef
For example, the following code fragment retrieves an SQL ARRAY value. For this example, the column SCORES in the table STUDENTS contains values of type ARRAY . The variable stmt is a Statement object. ResultSet rs = stmt.executeQuery( "SELECT SCORES FROM STUDENTS WHERE ID = 2238"); rs.next(); Array scores = rs.getArray("SCORES");
The variable scores is a logical pointer to the SQL ARRAY object stored in the table STUDENTS in the row for student 2238.
If you want to store a value in the database, you use the appropriate setXXX method. For example, the following code fragment, in which rs is a ResultSet object, stores a Clob object: Clob notes = rs.getClob("NOTES"); PreparedStatement pstmt = con.prepareStatement( "UPDATE MARKETS SET COMMENTS = ? WHERE SALES < 1000000", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); pstmt.setClob(1, notes);
This code sets notes as the first parameter in the update statement being sent to the database. The CLOB value designated by notes will be stored in the table MARKETS in column COMMENTS in every row where the value in the column SALES is less than one million
Which one is the best and efficient sort?
There are a great many sorts, Mergesort and Quicksort being among the most popular. These both have on the order of n*log n expected case runtime, and while Quicksort can get as bad as n^2, this is unlikely due to most implementations using a random pivot.
If you can make the assumption that ONLY NUMBERS will be sorted, you can use RadixSort, which is the fastest known sort for numbers.
As for how to sort in particular programming languages, consult your local API (in C++ it is in the STL's "algorithm" include file).
Write a program in c to sort an unsorted array using selection sort?
#include<stdio.h> #include<conio.h> int main() { char str[100],temp; int i,j; clrscr(); printf("Enter the string :"); gets(str); printf("%s in ascending order is -> ",str); for(i=0;str[i];i++) { for(j=i+1;str[j];j++) { if(str[j]<str[i]) { temp=str[j]; str[j]=str[i]; str[i]=temp; } } } printf("%s\n",str); getch(); return 0; } Output: Enter the string : syntax syntax in ascending order is -> anstxy
What is required in order to perform a binary search?
1. direct access to the elements
2. the elements are sorted
Why Java is called object oriented programming language?
Java is an object-oriented computer programming language that is used for application as well as system software development. It is best for web based applications such as servlets, XML design...etc., i.e. the applications that can run on the Internet. It can be used as front end tool for the back end database application. for example, the famous Oracle Database management system was designed using Java technology. It is also platform independent. meaning it can run under most platforms and OSs. Java technology was created as a computer programming tool in a small, secret effort called "the Green Project" at Sun Microsystems in 1991.
The secret "Green Team," fully staffed at 13 people and led by James Gosling, locked themselves away in an anonymous office on Sand Hill Road in Menlo Park, cut off all regular communications with Sun, and worked around the clock for 18 months.
They were trying to anticipate and plan for the "next wave" in computing. Their initial conclusion was that at least one significant trend would be the convergence of digitally controlled consumer devices and computers.
A device-independent programming language code-named "Oak" was the result.
To demonstrate how this new language could power the future of digital devices, the Green Team developed an interactive, handheld home-entertainment device controller targeted at the digital cable television industry. But the idea was too far ahead of its time, and the digital cable television industry wasn't ready for the leap forward that Java technology offered them.
As it turns out, the Internet was ready for Java technology, and just in time for its initial public introduction in 1995, the team was able to announce that the Netscape Navigator Internet browser would incorporate Java technology.
Now, nearing its twelfth year, the Java platform has attracted over 5 million software developers, worldwide use in every major industry segment, and a presence in a wide range of devices, computers, and networks of any programming technology.
In fact, its versatility, efficiency, platform portability, and security have made it the ideal technology for network computing, so that today, Java powers more than 4.5 billion devices: * over 800 million PCs * over 1.5 billion mobile phones and other handheld devices (source: Ovum) * 2.2 billion smart cards * plus set-top boxes, printers, web cams, games, car navigation systems, lottery terminals, medical devices, parking payment stations, etc. Today, you can find Java technology in networks and devices that range from the Internet and scientific supercomputers to laptops and cell phones, from Wall Street market simulators to home game players and credit cards -- just about everywhere.
The best way to preview these applications is to explore java.com, the ultimate marketplace, showcase, and central information resource for businesses, consumers, and software developers who use Java technology.
Why Software Developers Choose Java Technology
The Java programming language has been thoroughly refined, extended, tested, and proven by an active community of over five million software developers.
Mature, extremely robust, and surprisingly versatile Java technology has become invaluable in allowing developers to: * Write software on one platform and run it on practically any other platform * Create programs to run within a web browser and web services * Develop server-side applications for online forums, stores, polls, HTML forms processing, and more * Combine Java technology-based applications or services to create highly customized applications or services * Write powerful and efficient applications for mobile phones, remote processors, low-cost consumer products, and practically any device with a digital heartbeat
What is spanning tree in data structure?
A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.
//posted by Mr. VINOD KUMAR HOODA from HISAR, HARYANA
#include<stdio.h>
#include<conio.h>
void insert(int);
int delet(int);
void display(void);
void run(void);
void checkf(int z);
void checke(void);
int size=5;
int rear=-1;
int front=-1;
int queue[5]={55,66,77};
void main()
{
front+=1;
rear+=3;
int n;
int op;
printf("current queue is:");
display();
printf("\nPress:");
printf("\n1: for insertion of an element into the queue");
printf("\n2: for deletion of an element from the queue");
printf("\n3: check for full queue");
printf("\n4: check for empty queue");
printf("\n5: for exit\n");
scanf("%d",&op);
switch(op)
{
case 1:insert(size);break;
case 2:delet(size);break;
case 3:checkf(size); break;
case 4:checke(); break;
case 5:exit(1); break;
default:printf("\nWrong operator");
}
getch();
}
void insert(int n)
{
int item;
if(front!=-1&&rear!=n)
{
printf("\nEnter the item to be inserted");
scanf("%d",&item);
queue[rear+1]=item;
}
else
{
printf("\ncan not be inserted\n");
}
display();
}
int delet(int n)
{
printf("\ndeleted from queue\n");
if(front!=-1 && front!=rear)
{ run();
display();
}
else if(front!=-1 && front==rear)
{ run();
front=front-1;
display();
}
else if(front==-1)
{ printf("\nQueue is empty"); }
}
void display(void)
{
int i;
printf("\nDisplaying Queue\n");
for(i=0;i<size;i++)
printf("%d ",queue[i]);
}
void run(void)
{ int m,temp;
for(m=front;m<=rear-1;m++)
{temp=queue[m];
queue[m]=queue[m+1];
}
for(m=rear;m<size;m++)
{ queue[m]=0; }
rear=rear-1;
}
void checkf(int z)
{ if(rear==z-1)
{ printf("Queue is Full \n");
}
else
{ printf("Queue is not Full, new values can be inserted. \n");
}
}
void checke(void)
{ if(front==-1)
{ printf("Queue is empty \n");
}
else
{ printf("Queue is not empty, new values can be deleted. \n");
}
}
What are Mistakes that cause a running program to produce incorrect results?
You could call it a bug in general but more specifically code with no syntax errors (i.e. it compiles and runs) but doesn't produce the output you expect would be called a semantic error.
Difference between high level and low level languages?
Low level languages bring you close to the machine, e.g. Assembly, or C. High level languages obfuscate more, so it makes life as a programmer easier. Consider:
Python, garbage collected.
C, not garbage collected.
Java, garbage collected.
And so forth.
C does has its uses, still: how could one make a hardware driver with a garbage collected language?