#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],i,j,k,n;
printf("enter number of elements of array");
scanf("%d",n);
printf("Enter array elements");
for(i=1;i<=n;i++)
{
scanf("%d",a[i]);
}
printf("enter the element you want to delete");
scanf("%d",k);
for(j=0;j<n;j++)
{
if(a[j]==k)
{
a[j]=a[j+1];
n=n-1;
}
}
printf("The array after deletion of %d is:",k);
for(i=1;i<n;i++)
{
printf("%d",a[i]);
}
getch();
}
In queue insertion takes place on rear end and deletion takes place on front end. INSERTION(QUEUE,N,FRONT,REAR,ITEM) :QUEUE is the name of a array on which we are implementing the queue having size N. view comlete ans at http://mcabcanotes.in/algorithm-to-perform-insertion-and-deletion-in-a-queue/
How to write a program for mouse in microprocessor?
Reference:cprogramming-bd.com/c_page1.aspx# array programming
To write a C++ program to display the student details using class and array of object.
int findMax(int *array) { int max = array[0]; for(int i = 1; i < array.length(); i++) { if(array[i] > max) max = array[i] } return max; }
Create an array with 50 elements and input the integers one a time, filling the array. Use an insertion sort on the array for each input except the first. Alternatively, input the values first and then use insertion sort.
Linked list was introduced to reduce the space wastage done by array & also to make easier the insertion and deletion of elements from a list. A binary tree contains nodes of elements where insertion,deletion & searching is frequently done. So to make these operations easier linked list is used.
To efficiently implement a circular array in Python, you can use the collections.deque data structure. Deque allows for efficient insertion and deletion at both ends of the array, making it suitable for circular arrays. You can use the rotate() method to shift elements in the array, effectively creating a circular structure.
In a word, none. Linked lists are sequential and must be traversed sequentially. For random access you need an array, but you lose the efficiency of a list when it comes to insertion/deletion.
In queue insertion takes place on rear end and deletion takes place on front end. INSERTION(QUEUE,N,FRONT,REAR,ITEM) :QUEUE is the name of a array on which we are implementing the queue having size N. view comlete ans at http://mcabcanotes.in/algorithm-to-perform-insertion-and-deletion-in-a-queue/
Reference:cprogramming-bd.com/c_page1.aspx# array programming
How to write a program for mouse in microprocessor?
To write a C++ program to display the student details using class and array of object.
1) Array is a static data structure. Hence it has to be declared with a fixed size. Changing the size of the array involves procedures like relocation, freeing memory space, etc2) They hold elements of the same data type. Hence they are not suitable for storing and working with different data types. 3) Insertion and deletion in any place other than the end of the array has a time complexity of O(n).
write an assembly language program to find sum of N numbers
array type
int findMax(int *array) { int max = array[0]; for(int i = 1; i < array.length(); i++) { if(array[i] > max) max = array[i] } return max; }