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
(a) Write (delay ) as a special form for (lambda () ) and (force ), as discussed in class. (b) Write (stream-cons x y) as a special form, as discussed in class. (c) Write
Define min-heap A min-heap is a complete binary tree in which each element is less than or equal to its children. All the principal properties of heaps remain valid for min-hea
Q. Using array to execute the queue structure, write down an algorithm/program to (i) Insert an element in the queue. (ii) Delete an element from the queue.
how we can convert a graph into tree
Given are the definitions of some important terms: 1) Field: This is an elementary data item characterized by its size, length and type. For instance, Name
1) preorder, postorder and inorder 2) The main feature of a Binary Search Tree is that all of the elements whose values is less than the root reside into the nodes of left subtr
When there is requirement to access records sequentially by some key value and also to access records directly by the similar key value, the collection of records may be organized
Djikstra's algorithm (named after it is discovered by Dutch computer scientist E.W. Dijkstra) resolves the problem of finding the shortest path through a point in a graph (the sour
Write an algorithm to test whether a Binary Tree is a Binary Search Tree. The algorithm to test whether a Binary tree is as Binary Search tree is as follows: bstree(*tree) {
Ask question #Minimum 1cepted#
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