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);
Explain All-pair shortest-paths problem Given a weighted linked graph (undirected or directed), the all pairs shortest paths problem asks to find the distances (the lengths of
i need the full concept of it... please can anyone provide
Thread By changing the NULL lines in a binary tree to special links known as threads, it is possible to perform traversal, insertion and deletion without using either a stack
In the earlier unit, we have discussed about the arrays. Arrays are data structures of fixed size. Insertion & deletion involves reshuffling of array elements. Thus, arraymanipulat
Elaborate the symbols of abstract data type length(a)-returns the number of characters in symbol a. capitalize(a)-returns the symbol generated from a by making its first cha
need an expert to help me with the assignment
Implement multiple stacks in a single dimensional array. Write algorithms for various stack operations for them.
Threaded Binary Tree : If a node in a binary tree is not having left or right child or it is a leaf node then that absence of child node is shown by the null pointers. The spac
Program: Creation of Doubly Linked List OUTPUT Input the values of the element -1111 to come out : 1 Input the values of the element -1111 to come out : 2 Inpu
1.Create a flowchart to show the process that will allow the implementation of Stack, Push, and Pop operations. 2.Create a flowchart to show the process that will allow the impleme
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