Buissnesplan
Buissnesplan
#include <iomanip>
#include <cstdlib>
#include <ctime>
void Enqueue();
void Dequeue();
void Display();
int main()
srand(time(0));
const int n = 8;
int A[n], j;
RANDNUMBERS(A, n);
int por;
if (target == -1) {
else {
/* SHELLSORT(A, n);
}*/
if (index == -1) {
else {
cout << "the number is at the position " << index << endl;
}*/
//int i;
// Enqueue();
//}
//Dequeue();
//Dequeue();
//Display();
//return 0;
push('a', stack1);
push('x', stack2);
push('b', stack1);
push('y', stack2);
push('c', stack1);
push('z', stack2);
display(stack1);
display(stack2);*/
//---------------------------------------------------------------------------------------
SORTING-----------------------------------------------------------------------------------------------
//
*************************************************************************************
*************************************************************************************
***********
A[i + 1] = A[i];
i--; counter++;
A[i + 1] = key;
cout << "Number of iterations equals " << counter << endl;
temp = A[j];
A[j] = A[min];
A[min] = temp;
int j = i - 1;
A[j + 1] = A[j];
A[j + 1] = key;
int min_idx;
// unsorted subarray
// unsorted array
min_idx = i;
arr[min_idx] = arr[i];
arr[i] = temp;
// in place
arr[j + 1] = arr[j];
arr[j] = temp;
{
int L = 1, R = n - 1, k = n - 1;
int temp;
do
{ // L R
A[j - 1] = A[j];
A[j] = temp;
k = j;
L = k + 1;
A[j - 1] = A[j];
A[j] = temp;
k = j;
R = k - 1;
// Rearrange elements at each n/2, n/4, n/8, ... intervals i=1 temp =7
int j;
array[j] = temp;
B[C[A[j]]] = A[j];
C[A[j]] = C[A[j]] - 1;
int i;
BUILDMAXHEAP(A, n);
int heapsize = n - 1;
A[1] = A[i];
A[i] = temp;
heapsize = heapsize - 1;
MAXHEAPIFY(A, 1, heapsize);
int i, heapsize = n - 1;
int l, r, largest;
l = 2 * i;
r = 2 * i + 1;
else largest = i;
if (largest != i)
A[i] = A[largest];
A[largest] = temp;
//-----------------------------------------------------------------------------------------------
SEARCH-----------------------------------------------------------------------------------------
//
*************************************************************************************
*************************************************************************************
********************
if (r >= l) {
int mid = (l + r) / 2;
// If the element is present at the middle
// itself
if (arr[mid] == x)
return mid;
if (arr[mid] > x)
// in right subarray
// present in array
return -1;
while (l <= r) {
return mid;
if (arr[mid] < x)
l = mid + 1;
else
r = mid - 1;
// not present
return -1;
int i;
if (arr[i] == x) {
return i;
return -1;
}
if (arr[0] == x)
return 0;
// repeated doubling
int i = 1;
i = i * 2;
return binarySearchIter(arr, i / 2,
//---------------------------------------------------------------------------------------------
DATASTRUCTURES-----------------------------------------------------------------------------------
//
*************************************************************************************
*************************************************************************************
*******************
int queue[100], head = -1, tail = -1;
void Enqueue() {
int val;
if (tail == n - 1)
else {
if (head == -1) {
head = 0;
tail++;
queue[tail] = val;
void Dequeue() {
return;
else {
cout << "Element deleted from queue is : " << queue[head] << endl;
head++;
}
void Display() {
if (head == -1)
else {
if (top >= n - 1)
else {
top++;
array[top] = val;
else {
cout << "The popped element is " << array[top] << endl;
top--;
}
if (top >= 0) {
else
/*
#include <iostream>
struct Node
{int data;
Node* next;
};
{head->data = n;
head->next =NULL;
}
newNode->data = n;
newNode->next = NULL;
while (cur)
{ if(cur->next == NULL)
{ cur->next = newNode;
return;
cur = cur->next;
newNode->data = n;
newNode->next = *head;
*head = newNode;
while (cur)
cur = cur->next;
}
if (ptrDel == *head)
{ *head = cur->next;
delete ptrDel;
return true;
while (cur)
{ if (cur->next == ptrDel)
{ cur->next = ptrDel->next;
delete ptrDel;
return true;
cur = cur->next;
return false;
while (list)
int main()
initNode(head,10);
addNode(head,20);
addNode(head,30);
addNode(head,35);
addNode(head,40);
display(head);
insertFront(&head,5);
display(head);
searchNode(head,30);
int numDel = 5;
if (deleteNode (&head,ptrDelete))
display(head);
return 0;
struct Node
{int data;
Node* next;
};
{head->data = n;
head->next =NULL;
newNode->data = n;
newNode->next = NULL;
while (cur)
{ if(cur->next == NULL)
{ cur->next = newNode;
return;
cur = cur->next;
newNode->next = *head;
*head = newNode;
while (cur)
cur = cur->next;
if (ptrDel == *head)
{ *head = cur->next;
delete ptrDel;
return true;
while (cur)
{ if (cur->next == ptrDel)
{ cur->next = ptrDel->next;
delete ptrDel;
return true;
}
cur = cur->next;
return false;
while (list)
list = list->next;
int main()
initNode(head,10);
addNode(head,20);
addNode(head,30);
addNode(head,35);
addNode(head,40);
display(head);
insertFront(&head,5);
display(head);
searchNode(head,30);
int numDel = 5;
if (deleteNode (&head,ptrDelete))
display(head);
return 0;
*/