Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

java question below: 9. You have been asked to write a non-void, one-parameter m

ID: 3742135 • Letter: J

Question

java question below:

           

9.     You have been asked to write a non-void, one-parameter method to access nodes in a data set. What will be the argument passed to your method, and what will be the type of the returned value if the access mode is

a.   The key field mode?

b.   The node number mode?

10.   Nodes are stored in a linear list.

a.   What node comes just before node 6?

b.   What node comes just after node 6?

11.   Give the four basic operations performed on data structures, and tell what each operation does.

a.  

b.  

c.  

d.  

Explanation / Answer

9.We must know that all the four basic operations done on the node returns a boolean value except in case of the fetch operation.Boolean value false will be returned if the operation fails to complete its task.In case of 'fetch' operation it returns a reference to a requested node or a null reference if the requested node that we want to fetch from the data set is not available.

9.a.In case of the key field mode-

public boolean insert(keytype newnode)

public nodetype fetch(keytype targetkey)

public boolean delete(keytype targetkey)

public boolean update(keytype targetkey,nodetype desired_content)

9.b.In case of the node number mode:

public boolean insert(nodetype newnode)

public nodetype fetch(int nodenumber)

public boolean delete(int nodenumber)

public boolean update(int nodenumber,nodetype desired_content)

10.We say a collection of nodes are in linear fashion if there is a unique first node,unique last node and for any node Ni there must be an unique Ni-1 node before it and an unique Ni+1 node after it.

11.The four basic operation performed on data structures are-