Question about Compilers & Programming Tools

2 Answers

C++ program for insertion, deletion in linked list and 2d array pls send the details for linked list so that i can understand it the best..considering me as a beginner.

Posted by on

2 Answers

  • Level 1:

    An expert who has achieved level 1.

    Corporal:

    An expert that has over 10 points.

    Mayor:

    An expert whose answer got voted for 2 times.

  • Contributor
  • 1 Answer

Program for deletion


#include<iostream.h>
void main()
{
int a[10],i,n,x;
cout<<"\n\t\tPROGRAM TO DELETE AN NUMBER FROM AN ARRAY";
cout<<"\nEnter the size of the array:";
cin>>n;
for(i=0;i<n;i++)
{
cout<<"\nEnter the number:";
cin>>a[i];
}
cout<<"\nEnter the position to be deleted:";
cin>>x;
for(i=x;i<n;i++)
a[i]=a[i+1];
for(i=0;i<n-1;i++)
cout<<a[i]<<" ";
}

Posted on Mar 08, 2009

  • Engineer  S.W
    Engineer S.W Nov 24, 2010

    Can any one Explain me how to insert and delete from a linked list .....
    *****I will be thank full if any one of you can help me ...****

×

  • Level 1:

    An expert who has achieved level 1.

    Mayor:

    An expert whose answer got voted for 2 times.

  • Contributor
  • 1 Answer

I need a combination code insrtion, deletion , serching and sortiong code...

Posted on Jul 18, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Declare 2 arrays with 5 as index value of each. the user will input values to the first array(user-defined). Transfer value of the first array to the second array.Get the sum of the second...


You could do this by creating two arrays as such:
int firstArray[5]; int secondArray[5]
and then the sum variable:
int sum = 0;
then you could do a for loop to find the sum of the second array:

Feb 22, 2011 | Microsoft Visual C++ Professional Edition...

1 Answer

Twenty-five numbers are entered from the keyboard into an array.The number to be searched is entered through the keyboard by user.Write a program to find if the number to be searched is present in the...


pseudo is
-> integer type count =0;
->Take input from user 'Number'
->loop from 0th to 24th element
->Compare each element with user entered number and if it matches then do count++.
finally display the count.

Jul 29, 2010 | Advanced Graphics Programming Using OpenGL...

1 Answer

How to form an array in visual basics(Express)


samples of arrays in vb.net
1)
dim array(3) as integer

array(0)=1
array(1)=2
array(2)=3
array(3)=4

2) dim array() as integer

array=new integer(){1,2,3,4}

3) for two dimensional arrays add comma separation to the size

May 28, 2010 | Microsoft Visual Basic Enterprise Edition...

1 Answer

Make a program that will accept tthe size of an array (number must be greater than). Enter and fill the array with numbers then sort in descending order (largest to smallest). Display the unsorted and...



coding in C++

#include<iostream.h>
#include<conio.h>
#define max 50

void main()
{
clrscr();
int arr[max],size=0;
int i=0,j=0,temp;
do
{
cout<<"Enter the size of array(less than or equal to 50)";
cin>>size;
} while(size>50);

for(i=0;i<size;i++){
cout<<"Enter a number";
cin>>arr[i];
}


for( i=1;i<size;i++){
for(j=0;j<size;j++){
if(arr[j+1]>arr[j]){
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;


}

}
}
cout<<”Array in descending order”;
for(i=0;i<size;i++){
cout<<arr[i]<<"\n";
}
getch();
return 0;
}

Mar 09, 2010 | Compilers & Programming Tools

1 Answer

How to store in an array the records in a listview


create form1 with one list box and form2 with text boxes and command button.
Go to project >project properties>start object will be form2..
Here i takenexamble of two textboxes..code is below
Private Sub Command1_Click()
Form1.List1.AddItem Text1.Text, 0
Form1.List1.AddItem Text2.Text, 1
Form1.Show
End Sub


hope this will help you...Thank you,....

Nov 11, 2009 | Microsoft Visual Basic Professional...

1 Answer

I was advised that this program TotalCAD 2D/3D would run on XP


As I see Totalcad 2D-3D is a little old program. Try to use compatibility mode for setup.exe
Also i give you a link to be more clear with that program. There you'll se on which OS is shoul work.

Aug 05, 2009 | Compilers & Programming Tools

1 Answer

Don't Send error while running a vc++ Application


If u use arrays and/or stacks make sure u access and write properly

Jun 19, 2009 | Compilers & Programming Tools

1 Answer

Insertion sort


<!--StartFragment-->
Function InsertionSort(ByVal TempArray As Variant) As Variant
' Written By Louis Sutherland
' 1/25/99
' will be the sorted arrary when finishe
' d
Dim SortedList As Variant
Dim x, y As Integer
Dim NumSorted As Integer
'This Set up SortedList as an Array
SortedList = TempArray
'This zeroizes the new array


For x = 1 To UBound(SortedList)
SortedList(x) = 0
Next x
'sets the Total num counted to 1
NumSorted = 1
' Processes first element
SortedList(1) = TempArray(1)


For x = 2 To 5000
' insertion loop


For y = NumSorted To 1 Step -1
' if current value is <= then insert in
' next place


If TempArray(x) >= SortedList(y) Then
SortedList(y + 1) = TempArray(x)
'This Breaks the loop
y = 1
Exit For
Else


If y = 1 Then
SortedList(y + 1) = SortedList(y)
SortedList(y) = TempArray(x)
Exit For
Else
' save the value to the next spot
SortedList(y + 1) = SortedList(y)
End If
End If
Next y
'advance total num sorted
NumSorted = NumSorted + 1
Next x
InsertionSort = SortedList
End Function




Mar 17, 2009 | Microsoft Visual Basic 6.0 for PC

2 Answers

Source code for word count


Haha, i wrote one of thee a while ago for a competition. You need to us e the char at function mate :D
Inside a for loop
Ill havea look for you though :D

Sep 09, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

2 Answers

C++ programs


An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier
Initializing arrays. When declaring a regular array of local scope (within a function, for example), if we do not specify otherwise, its elements will not be initialized to any value by default, so their content will be undetermined until we store some value in them. The elements of global and static arrays, on the other hand, are automatically initialized with their default values, which for all fundamental types this means they are filled with zeros
include <iostream>
using namespace std;

int billy [] = {16, 2, 77, 40, 12071};
int n, result=0;

int main ()
{
for ( n=0 ; n<5 ; n++ )
{
result += billy[n];
}
cout << result;
return 0;
}
multidimensional array pseudo-multidimensional array #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT][WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n][m]=(n+1)*(m+1); } return 0; } #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n*WIDTH+m]=(n+1)*(m+1); } return 0; }
and now for trignometry
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
int factorial(int);
int n = 3, i = 1;
double x, x2, b, PI, r;
char choice;
//r = x * (PI / 180)

cout<<"Please enter an angle value => ";
cin>>x;
cout<<"Is the angle value in Degree or Radian?"<<endl;
cout<<"Type D if its in degree "<<endl;
cout<<"Type R if its in radian "<<endl;
cin>>choice;


if((choice = 'R')||(choice = 'r'))
do{
i++; n = 3; x2 = 0; b = x2;
{
if(i == 1)
x2 = x - (pow(x,n) /factorial(n));
n = n + 2;
};
else
{
x2 = (x2 + ((pow(x,n)) /(factorial(n))) - (pow(x,n+2)) / (factorial(n+2)));
n = n + 4;
}


}while(abs(b - x2) > 0.000001);
else
//convert it to r

r = x * PI /180;

//cout<<"error occured/n";
cout<<"sin(x) = "<<x2<<endl;

return 0;
}

Mar 24, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

Not finding what you are looking for?
Compilers & Programming Tools Logo

Related Topics:

3,108 people viewed this question

Ask a Question

Usually answered in minutes!

Top Compilers & Programming Tools Experts

Robin Hill
Robin Hill

Level 3 Expert

1251 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18298 Answers

Florin

Level 3 Expert

733 Answers

Are you a Compiler and Programming Tool Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...