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 an algorithm that counts number of nodes in a linked list.
Ans.
Algorithm to Count No. of Nodes in Linked List
COUNT (INFO, LINK, START, NUM)
1. Set NUM: = 0 [initializes counter]
2. Set PTR=START [ initializes pointer]
3. Repeat steps 4 & 5 while PTR! = NULL
4. Set NUM:= NUM + 1 [ increases NUM by 1]
5. Set PTR: =LINK [PTR] . [updates pointer to point to next node]
[End of step 3 loop]
6. Return
Determine the importance of array Arrays are significant since they allow many values to be stored in a single data structure whereas providing very fast access to each value.
One of the main problems with the linear queue is the lack of appropriate utilization of space. Assume that the queue can store 100 elements & the complete queue is full. Thus, it
Post order traversal: The children of node are visited before the node itself; the root is visited last. Each node is visited after its descendents are visited. Algorithm fo
You are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measuring marker on it. There is a tap that can be used to fill the jugs with water. How can you get exac
Q. What is the smallest value of n such that an algorithm whose running time is 100n2 runs faster than an algorithm whose running time is 2n on the same machine. A n
write an algorithm for multiplication of two sparse matrices using Linked Lists
The best algorithm to solve a given problem is one that requires less space in memory and takes less time to complete its execution. But in practice it is not always possible to
Define Spanning Tree A Spanning Tree of a connected graph is its linked acyclic sub graph (i.e., a tree) that having all the vertices of the graph.
Like general tree, binary trees are implemented through linked lists. A typical node in a Binary tree has a structure as follows struct NODE { struct NODE *leftchild; i
A shop sells books, magazines and maps. Every item is identified by a unique 4 - digit code. All books have a code which starts with 1, all maps have a code starting with 2 and all
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