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);
Q. Sort the sequence written below of keys using merge sort. 66, 77, 11, 88, 99, 22, 33, 44, 55 Ans:
Loops There are 3 common ways of performing a looping function: for ... to ... next, while ... endwhile and repeat ... until The below example input 100 numbers and find
Encryption the plain-text using the round keys: 1. (Key schedule) Implement an algorithm that will take a 128 bit key and generate the round keys for the AES encryption/decryp
Q. Create a heap with the given list of keys: 8, 20, 9, 4, 15, 10, 7, 22, 3, 12 Ans: Creation
A shop sells books, maps and magazines. Every item is identified by a unique 4 - digit code. All books have a code starting with a 1, all maps have a code which starts with a 2 and
1. Write a pseudocode algorithm to print the numbers from 1 to 10, and then from 10 to 1, using exactly one loop. 2. The function contains() takes a food as an argument and tell
Explain divide and conquer algorithms Divide and conquer is probably the best known general algorithm design method. It work according to the following general p
Write a function that performs the integer mod function. Given the previous functions you have implemented already, this one should be a piece of cake. This function will find the
Graph Traversal In many problems we wish to investigate all the vertices in a graph in some systematic order. In graph we often do not have any single vertex singled out as spe
using a program flowchart design a program to illustrate pop and push operation
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: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd