Link 1
Link 1
Link 1
https sites.google
sites google.com
google com/site
com site/javaprogramsisc
site javaprogramsisc/
javaprogramsisc ISC Theory Questions 143
Write a method OR an algorithm to compute and return the sum of all integers items stored in the
linked list. The method declaration is specified below:
int listsum(ListNodes start);
[2010]
Write an algorithm OR a method to search for a name and display the contents of that node. The
method declaration is given below :
void search( node start, String b)
[2012]
STEP 1 : Start
STEP 2 : Set the pointer to first node
STEP 3 : Repeat Step 4 and 5 untill pointer is not null
https://sites
https sites.google
sites google.com
google com/site
com site/javaprogramsisc
site javaprogramsisc/
javaprogramsisc ISC Theory Questions 145
STEP 1 : Start
STEP 2 : Set pointer to first Node
STEP 3 : Set count = 0
STEP 4 : Repeat Step 5 and 6 until pointer is not null
STEP 5 : count ++
STEP 6 : move pointer to next node
STEP 7 : Display count
STEP 8 : End
Write an Algorithm OR a Method to add a node at the end of an existing linked list.
The method declaration is as follows:
void addnode(Node start, int num)
[2014]
STEP 1 : Start
STEP 2 : Set temporary pointer to start node
STEP 3 : Repeat step 4 until it reaches null
STEP 4 : Move pointer to the next node
STEP 5 : Create new node
STEP 6 : Assign num to number
STEP 7 : Stop
117 Link Lists are linear data structure. Create Algorithms for the following operations:
(i) Insertion of a Node at the beginning in a Link List.
(ii) Deletion of the first Node in a Link list.
[2010 SP]
118 A Linked List is formed from the objects of the class,
class Node
{
int num;
Node next;
}
Write the algorithm OR a method for inserting a node in the end of the list.
The method declaration is given below :
void insertnode(Node start)
[2013SP]