GeekInterview.com
Series: Subject: Topic:

Data Structures Interview Questions

Showing Questions 1 - 20 of 236 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

The hashstring() member function is called by other member functions of the hashtable class whenever a function needs to convert a ________________.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: hash tablea) a hash number key to a keyb) key to a hash number keyc) a key to an indexexplanation: the hashstring() member function is another function called by other member functions of the hashtable class whenever a function needs to convert a key to a hash number key. The hashstring()...

Answered by: Sandhya.Kishan on: May 21st, 2012

The hashString() member function is called by other member functions of the Hashtable class whenever a function needs to convert a key to hash number key.

Why is it important to enhance the functionality of the linkedlist class?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks and queues: insert, delete, peek, finda) you enhance the functionality of linkedlist class to more easily manipulate a linked list

Answered by: Sandhya.Kishan on: May 19th, 2012

To increase the efficiency of the linkedliss class and to allow easy manipulations on the linked list we should enhance the functionality of the class.

The removenodeat() function removes a node by using the node’s index?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks and queues: insert, delete, peek, finda) trueb) falseexplanation: the removenodeat() function removes a node by using the node’s index rather than the reference to the node in memory

Answered by: Sandhya.Kishan on: May 19th, 2012

True, the removenodeat() function removes a node by using the nodes index and not by the the reference to the node in memory.

Hashing results in a hash number that has great significance.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: hash tablea) trueb) falseexplanation: hashing results in a hash number that has no real significance beyond it being used as the key for an entry.

Answered by: Sandhya.Kishan on: May 19th, 2012

The hash number resulted from hashing is used as the key for an entry.

The constructor of the hashtable class initializes data members and creates the hashtable.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: hash tablea) trueb) falseexplanation: the constructor of the hashtable class initializes data members and creates the hashtable. The size of the array of pointers (tablesize) is passed to the constructor when the application declares an instance of the hashtable class

Answered by: Sandhya.Kishan on: May 19th, 2012

The size of the array of pointers (tablesize) is passed to the constructor when the application declares an instance of the Hashtable class and therefore the constructor of the hashtable class initializes data members and creates the hashtable.

The linkedlist class is defined in the _______ package.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks and queues: insert, delete, peek, finda) Java.Util

Answered by: Sandhya.Kishan on: May 15th, 2012

The linkedlist class is defined in the java.util package.

The insertnodeat() function can place a node at the front or back of a linked list if you pass the appropriate index to this function.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks and queues: insert, delete, peek, finda) trueb) false

Answered by: Sandhya.Kishan on: May 15th, 2012

True,insertnodeat() function specifies the index where to insert the new node in the linked list.

Conceptually, a linked list queue is the same as a queue built using an array.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: queues using linked listsa) trueb) falseexplanation: conceptually, a linked list queue is the same as a queue built using an array. Both store data. Both place data at the front of the queue and remove data from the front of the queue

Answered by: Sandhya.Kishan on: May 15th, 2012

A queue built using array is same as a linked list queue because both insert the data in the front and delete the data from front of the queue,i.e,both follow fifo data structure.

The appendnode() function appends the new node to the list along with the programmer specifing where to place the new node in the linked list.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks and queues: insert, delete, peek, finda) trueb) falseexplanation: the appendnode() function appends the new node to the list without requiring the programmer to specify where to place the new node in the linked list.

Answered by: Sandhya.Kishan on: May 15th, 2012

No,the appendNode() function do append the new node at the programmers specified place instead it appends the new node at the tail of the linked list instead of head.If the likt is empty then it uses reference pointer to change the head pointer.

Why is the destructor of the stacklinkedlist class empty?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks using linked lista) the destructor of the stacklinkedlist class is empty because the destructor of the linkedlist class is called prior to the destructor of the stacklinkedlist class. This is because the linkedlist class is inherited by the stacklinkedlist class.

Answered by: Sandhya.Kishan on: May 15th, 2012

The destructor of the LinkedList class is called before the destructor of the StackLinkedList class. The LinkedList class constructor deletes all memory that is associated with the nodes of the linked list. Therefore, the destructor of the StackLinkedList class is empty.

Why is the constructor of the stacklinkedlist class empty?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks using linked lista) the constructor of the stacklinkedlist class is empty because the constructor of the linkedlist class is called when an instance of the stacklinkedlist class is declared. The constructor of the linkedlist class initializes the node and attributes that are

Answered by: Sandhya.Kishan on: May 15th, 2012

The constructor is empty because the constructor of the LinkedList class is called before the constructor of the StackLinkedList class,we know that the StackLinkedList class inherits the LinkedList cl...

Why does queuelinkedlist class inherit the linkedlist class?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: queues using linked listsa) the queuelinkedlist class inherits the linkedlist class because the linkedlist class contains data members and function members that are necessary to manage the linked list that is used for the queue.

Answered by: Sandhya.Kishan on: May 14th, 2012

True,as the linkedlist class contains the functions and data members which are used to manage the linked list which is used for the queues,hence queuelinkedlist class inherit the linkedlist class.

The C++ version of the hashtable application is simpler than the Java version.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: hash tablea) trueb) falseexplanation: the Java version of the hashtable application is simpler than the C++ version because the Java version defines the hashtable class in the Java collection classes that are defined in the Java.Util package

Answered by: Sandhya.Kishan on: May 14th, 2012

The hash table applications of java are simpler then c++ because java defines a class in java collection class called HASHTABLE class which is present in the java.util package.

Getsize() function is used to protect the integrity of the data.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: hash tablea) trueb) falseexplanation: the getsize() member function of the hashtable class reads the size data member of the hashtable class and returns its value to the statement that calls the getsize() function. If you gave the application direct access to the size data member, statements...

Answered by: Sandhya.Kishan on: May 14th, 2012

True,GetSize() function is used to protect the integrity of the Data by controlling the access to the size parameter, such that only the function members of the hashtable can access the size parameter.

_______ form of access is used to add and remove nodes from a queue.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: queues using linked listsa) fifo , first in first out

Answered by: Sandhya.Kishan on: May 10th, 2012

Queues are first in first out form of data structures.In a FIFO data structure, the first element added to the queue will be the first one to be removed.

Which node is removed from the queue when the dequeue() member method is called?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: queues using linked listsa) the node at the front of the queue is removed when the dequeue() member method is called.

Answered by: Sandhya.Kishan on: May 10th, 2012

The dequeue() function is used to remove the node at the front and returns a value, this value is stored in an item.

The isempty () member function must determine if the stack is empty.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: stacks using linked lista) trueb) falseexplanation: the pop () member function must determine if the stack is empty

Answered by: Sandhya.Kishan on: May 10th, 2012

False.
The pop() function determine whether the stack is empty or not by calling the isEmpty() member function..

A ______ is a component of a node that identifies the node.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: treea) valueb) treec) keyd) indexexplanation: a key is a component of a node that identifies the node. An application searches keys to locate a desired node

Answered by: Sandhya.Kishan on: May 8th, 2012

The data model provides unique keys as a component of the node which identifies the node.

A value is also a component of a node that is used to store data.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: treea) trueb) false

Answered by: Sandhya.Kishan on: May 8th, 2012

True, a value is also a component of a node which is used to store data.

A key entered by an application be directly compared to a key in a hashtable.

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

Skill/topic: hash tablea) trueb) falseexplanation: no. A key entered by the application must be hashed before it can be compared to a key in the hashtable.

Answered by: Sandhya.Kishan on: May 8th, 2012

False.
The key entered must be hashed before an application compares it with the hash key table.

First | Prev | | Next | Last Page

 

 

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us:
 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, click "Subscribe".