Page 549 - Computer science 868 Class 12
P. 549
12. A linked list is formed from the objects of the class Link. The class details are given below.
class Link
{
int n;
Link next;
}
Write an algorithm or a method to find the highest number in the linked list.
The method declaration is as follows: int FindHighest(Link start)
13. A linked list is formed from the objects of the class LinkNm. The class details are given below.
class LinkNm
{
String name;
LinkNm next;
}
Write an algorithm or a method to print the names from the given linked list starting with ‘A’. The method declaration is as follows:
void printA(LinkNm head)
14. A linked list is formed from the objects of the class Node. The class details of Node are given below.
class Node
{
int n;
Node link;
}
Write an algorithm or a method to reverse the existing linked list using method given as follows:
void reverse(Node startptr)
15. Answer the following questions from the given diagram of a Binary Tree.
A
B C
D E I
F J G
H
a. Name the root of the tree.
b. Name the leaf nodes of the right sub-tree
c. Write pre order, post order and in order traversal of the left sub tree of node B.
d. State the level number, height, depth of nodes E and B when the root is at level 0.
e. Name the internal nodes of the tree.
f. Name the siblings in the tree.
g. Name the parent node and child node of C.
h. What is the size and degree of the tree?
i. Is the tree balanced? Justify your answer.
j. Is the tree complete? Justify your answer.
Previous Years' Questions
1. What is the importance of the reference part in a Linked List? [ISC 2023]
Ans. Reference part in a Linked List holds the address of the next node in the Linked List.
2. Convert the following infix notation to prefix notation. [ISC 2023]
(A – B)/C*(D + E)
547
Data Structures 547

