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. Implement a stack making use of the linked list. Show the PUSH and POP operations both.
Ans.
Stack implemantation using linked list
# include
struct link
{
int info ;
struct link *next;
} *start;
struct link * push (struct link * rec)
struct link *new_rec;
printf ("\n Input the new value for next location of the stack:") ;
new_rec = (struct link *) malloc (size of
(struct link)) ;
scanf ("%d", &new_rec->info) ;
new_rec->next = rec;
rec = new_rec;
return (rec);
}
struct link * pop (struct link * rec)
struct link * temp ;
if (rec == NULL)
else
printf ('\n Stack is empty") ;
temp = rec; rec= temp->next;
printf("the popped element %d", temp->.info);
free(temp) ;
return(rec);
In the array implementation of the lists, we will use the array to hold the entries and a separate counter to keep track of the number of positions are occupied. A structure will b
Q. Write down an algorithm for finding a key from a sorted list using the binary search technique or method.
Definition: A set of data values & related operations that are accurately specified independent of any particular implementation. As the data values and operations are described
Illustrate an example of algorithm Consider that an algorithm is a sequence of steps, not a program. You might use the same algorithm in different programs, or express same alg
Surrounding of sub division method A polygon surrounds a viewport if it completely encloses or covers the viewport. This happens if none of its sides cuts any edge of the viewp
reverse the order of elements on a stack S using two additional stacks using one additional stack
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
As we have seen, as the traversal mechanisms were intrinsically recursive, the implementation was also easy through a recursive procedure. Though, in the case of a non-recursive me
What is Keyed Access- Container A collection may allow its elements to be accessed by keys. For instance, maps are unstructured containers which allows their elements to be
The below figure illustrates the BOM (Bill of Materials) for product A. The MPS (Material requirements Planning) start row in the master production schedule for product A calls for
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