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. Write down a programme in C to create a single linked list also write the functions to do the following operations
(i) To insert a new node at the end
(ii) To delete the first node
Ans:
//Create a single list
struct node
{
int data;
struct node *link
}
struct node *p,*q;
//Inserting a node at the end(append)
append(struct node **q,int num)
struct node *temp; temp=*q; if(*q==NULL)
*q=malloc(sizeof(struct node *));
temp=*q;
else
while(temp link!=NULL)
temp=temp link;
temp link = malloc(sizeof(struct node *));
Temp data=num;
temp link=NULL;
//Delete the first node delete(struct node *q,int num)
struct node *temp;
*q=temp link;
free(temp);
An undirected graph G with n vertices and e edges is shown by adjacency list. What is the time required to generate all the connected components? O (e+n)
How do you find the complexity of an algorithm? Complexity of an algorithm is the measure of analysis of algorithm. Analyzing an algorithm means predicting the resources that
Write an algorithm to count number of nodes in the circular linked list. Ans. Counting No of Nodes in Circular List Let list be a circular h
In this respect depth-first search (DFS) is the exact reverse process: whenever it sends a new node, it immediately continues to extend from it. It sends back to previously explore
memory address of any element of lower left triangular sparse matrix
Using the cohen sutherland. Algorithm. Find the visible portion of the line P(40,80) Q(120,30) inside the window is defined as ABCD A(20,20),B(60,20),C(60,40)and D(20,40)
Which are the two standard ways of traversing a graph? i. The depth-first traversal ii. The breadth-first traversal
A BST is traversed in the following order recursively: Right, root, left e output sequence will be in In Descending order
Give an algorithm to find both the maximum and minimum of 380 distinct numbers that uses at most 568 comparisons.
Determine in brief the Painter Algorithm a) The farthest polygon, namely the rectangle PQRS, is stored first. (b) The next farthest, the quadrilateral ABCD, is superpo
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