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!
Program: Creation of a linked list
In the next example, wewill look to the process of addition of new nodes to the list with the function create_list().
#include
#define NULL 0
structlinked_list
{
int data;
structlinked_list *next;
};
typedefstructlinked_list list;
void main()
list *head;
void create(list *);
int count(list *);
void traverse(list *);
head=(list *)malloc(sizeof(list));
create(head);
printf(" \n traversing the list \n");
traverse(head);
printf("\n number of elements in the list %d \n", count(head));
}
void create(list *start)
printf("input term -1111to getting out of the loop\n");
scanf("%d", &start->data);
if(start->data == -1111)
start->next=NULL;
else
start->next=(list*)malloc(sizeof(list));
create(start->next);
void traverse(list *start)
if(start->next!=NULL)
printf("%d --> ", start->data);
traverse(start->next);
int count(list *start)
if(start->next == NULL)
return 0;
return (1+count(start->next));
explain quick sort algorithm
Your first task will be to come up with an appropriate data structure for representing numbers of arbitrary potential length in base 215. You will have to deal with large negative
two standards ways of traversing a graph in data structure
: Write an algorithm to evaluate a postfix expression. Execute your algorithm using the following postfix expression as your input: a b + c d +*f .
Q. How do we represent a max-heap sequentially? Explain by taking a valid example. Ans: A max heap is also called as a descending heap, of size n is an almos
How memory is freed using Boundary tag method in the context of Dynamic memory management? Boundary Tag Method to free Memory To delete an arbitrary block from the free li
Linear search is not the most efficient way to search an item within a collection of items. Though, it is extremely simple to implement. Furthermore, if the array elements are arra
Draw trace table and determine the output from the below flowchart using following data (NOTE: input of the word "end" stops program and outputs results of survey): Vehicle = c
A binary search tree is constructed through the repeated insertion of new nodes in a binary tree structure. Insertion has to maintain the order of the tree. The value to the lef
include int choice, stack[10], top, element; void menu(); void push(); void pop(); void showelements(); void main() { choice=element=1; top=0; menu()
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