Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Devise a representation for a given list where insertions and deletions can be made at both the ends. Such a structure is called Deque (which means Double ended queue). Write functions for inserting and deleting at both the ends.
Ans:
struct Deque
{
int info;
struct Deque *left, *right;
}*head, *tail;
add(struct Deque *p, int x)
struct Deque *temp;
temp = malloc (sizeof(struct Deque), 1);
temp -> info = x;
if(p == head)
temp->right = head; temp->left = NULL; head->left = temp;
head = temp;
}
else if(p == tail)
temp->left = tail; temp->right = NULL; tail->right = temp; tail = temp;
delete(struct Deque *p, int x)
temp = head;
head = head->right;
head->left = NULL; temp->right = NULL; free(temp);
temp = tail;
tail = tail->left; tail->right = NULL; temp->left = NULL; free(temp);
Ask question #Minimum 1cepted#
#include #include int sumFact(int numb); int calculateFactorial(int digit); main() { int numb, sumfact; do{ printf ("Enter a number 1 to 9999\n"); scanf("%
advanatges of dynamic data structure in programming
Merging 4 sorted files having 50, 10, 25 and 15 records will take time
Which sorting algorithm is best if the list is already sorted? Why? Insertion sort as there is no movement of data if the list is already sorted and complexity is of the order
Determine the importance of array Arrays are significant since they allow many values to be stored in a single data structure whereas providing very fast access to each value.
Arrays are simple, however reliable to employ in more condition than you can count. Arrays are utilized in those problems while the number of items to be solved out is fixed. They
Thus far, we have been considering sorting depend on single keys. However, in real life applications, we may desire to sort the data on several keys. The simplest instance is that
This section prescribes additional exercise with the recursive and iterative handling of a binary search tree. Adding to the Binary Search Tree Recursively Add implementation
solve the following relation by recursive method: T(n)=2T(n^1/2)+log n
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd