UGRD ITE6201 2016S Data Structure Algorithm

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

0 Value of first linked list index is _______________.

2 Each node in singly linked list has _______ fields.


all of these Which of the following is an application of stack?
AVAIL  Which is the pointer associated with the availability list?
Back  New nodes are added to the ________ of the queue.
In linked representation of stack, the null pointer of the last
Bottom of the stack
node in the list signals ____________
circular linked list A linear list in which the last node points to the first node.
circular linked list In linked lists, there are no NULL links in ______________
This is a linear list in which insertions and deletions are made
Dequeue 
to form either end of the structure.
FIFO lists Which of the following names does not relate to stacks?
FIFO  What is a queue?
This form of access is used to add and remove nodes from a
FIFO, First In First Out
queue.
first record of the actual The dummy header in linked list contains
data ____________________.
for the size of the structure
and the data in the structure Linked lists are best suited _____________________.
are constantly changing
front  Deletion operation is done using __________ in a queue.
This may take place only when there is some minimum
Garbage collection
amount or no space left in free storage list.
In linked representation of stack, ___________ fields hold the
INFO 
elements of the stack.
This form of access is used to add/remove nodes from a
LIFO
stack.
LIFO  Stack follows the strategy of ________________.
In a linked list, the ____________ contains the address of
Link field
next element in the list.
List This refers to a linear collection of data items.
List traversed in two
Which of the following is a two-way list?
directions
Indexing the ________________ element in the list is not
middle 
possible in linked lists.
Pop This is the term used to delete an element from the stack.
pop  The retrieval of items in a stack is ___________ operation.
predecessor node LINK is the pointer pointing to the ____________________.
push  The term used to insert an element into stack.
push  This is the insertion operation in the stack.
Reverse  The elements are removal from a stack in _________ order.
Sentinel  This indicates the end of the list.
A linear list in which the pointer points only to the successive
singly linked list
node.
small batches of records
What is a run list?
from a file
stacks The term push and pop is related to _____________
In the linked representation of the stack, __________ pointer
Start 
behaves as the top pointer variable of stack.
The new node is placed at
What happens when you push a new node onto a stack?
the front of the linked list
A pointer variable which contains the location at the top
Top
element of the stack.
TOP Which is the pointer associated with the stack?
The operation of processing each element in the list is known
traversal 
as ________________.
Each node in a linked list must contain at least
Two fields
___________________.
The situation when in a linked list START=NULL is
Underflow 
____________________.
In linked representation of stack, the null pointer of the last
Bottom of the stack
node in the list signals _____________________.
Reverse "The elements are removal from a stack in _________ order. "
stacks The term push and pop is related to _____________.
"This form of access is used to add/remove nodes from a
Dequeue
stack. "
Inserting an item into the stack when stack is not full is called
____________ while operation and deletion of item from the
push, pop
stack, when stack is not empty is called ________________
operation.
It is a pile in which items are added at one end and removed
queue
from the other.
A word processor to have a PF key that causes the preceding
command to be redisplayed. Every time the PF key is
Stack
pressed, the program is to show the command that preceded
the one currently displayed
FALSE A binary search tree is another name for a binary tree.
TRUE Binary search trees are ordered.
Algorithms that use a list must know whether the list is array
FALSE
based or linked.
The value in the left child of a node (if it exists) in a binary
FALSE
search tree will be greater than the value in the node itself.
Which data structure is used in breadth first search of a graph
Queue
to hold nodes?
The value in the right child of a node (if it exists) in a binary
TRUE
search tree will be greater than the value in the node itself.
FALSE A stack displays FIFO behavior.
A program keeping track of where canned goods are located
Stack
on a shelf.
A binary search tree whose left subtree and right subtree differ
AVL tree
in height by at most 1 unit is called ____________________.
FALSE A stack and a queue are different names for the same ADT.
A bank simulation of its teller operation to see how waiting
Queue
times would be affected by adding another teller.
Graph Which of the following data structure is non-linear type?
TRUE In a graph, the vertices represent the items being modeled.
Which of the following is/are the levels of implementation of
All of these
data structure?
A program to keep track of patients as they check into a
Queue medical clinic, assigning patients to doctors on a first-come,
first-served basis.
A list may be linear or nonlinear, depending on its
FALSE
implementation.
FALSE A binary search cannot be applied to a tree.
TRUE A leaf in a tree is a node with no children.
A program to receive data that is to be saved and processed
Stack
in the reverse order.
____________________ level is where the model becomes
Implementation level
compatible executable code.
Binary search tree An electronic address book ordered by name
This is very useful in situation when data have to be stored
stack
and then retrieved in reverse order.
TRUE The root of a tree is the node that has no ancestors.
Last in, first out Stack is also called the ________________.
Stack Which of the following data structures is linear type?
____________________ is not the component of data
None of these
structure.
Indicate which structure would be a more suitable choice for
Tree, Binary search tree
each of the following applications.
Identify the data structure which allows deletions at both ends
Input restricted dequeue
of the list but insertion at only one end.
Graph A program to maintain the routes in an airline.
A binary tree is a tree in which each node can have zero, one,
TRUE
or two children.
None of these Which of the following is not the part of ADT description?
Which data structure is suitable to represent the hierarchal
Tree
relationship between elements?
Binary tree Herder node is used as sentinel in __________________.
Which data structure allows deleting data elements from and
queues
inserting at rear?
A _______________ is a data structure that organizes data
Queue linked list similar to a line in the supermarket, where the first one in line
is the first one out.
A dictionary of words used by a spelling checker to be built
Binary search tree
and maintained.
On average, searching in a binary search tree is faster than
FALSE
searching in a list.
Which of the following data structure can't store the non-
Arrays
homogeneous data elements?
Trees Which of the following is non-linear data structure?
FALSE A queue displays LIFO behavior.
A program to keep track of the soccer teams in a city
Tree
tournament

Fill in the following table, using Big-O notation to give the worst and average-case times for each of
the stack methods for a stack of size N.

OPERATION WORST-CASE TIME AVERAGE-CASE TIME

Constructor O(1) O(1)

Empty O(1) O(1)

Size O(1) O(1)

Push O(N) O(1)

Pop O(1) O(1)

Peek O(1) O(1)

In a graph, if e=[u,v], then u and v are called

= End points of e

This is a binary tree whose every node has either zero or two children.

= binary search tree


The average case occurs in linear search algorithm

= when item is somewhere in the middle of the array

___________ sorting algorithm is frequently used when n is small, where n is the total number of
elements.

= Insertion

Which of the following is not the required condition for binary search algorithm?

= There must be mechanism to delete and/or insert elements in list

The complexity of linear search algorithm.

= O(n)

Graph G is _____________ if for any pair u, v of nodes in G, there is a path from u to v or path from v to
u.

= Unliterally connected

The complexity of sorting algorithm measures the __________ as a function of the number n of items to
be shorter.

= running time

The worst case occurs in linear search algorithm when

= Item is the last element in the array or item is not there at all

Another name for directed graph.

= Digraph

The rearranging of pairs of elements which are out of order, until no such pairs remain.

= Exchange

If the number of records to be sorted is small, then __________ sorting can be efficient.

= Selection

TREE[1]=NULL indicates tree is

= Empty

Which of the following sorting algorithm is of priority queue sorting type?

= Selection sort

Every node N in a binary tree T except the root has a unique parent called the ________ of N.

= Predecessor
Trees are ________ if they are similar and have the same contents at corresponding nodes.

= copies

What does the sequential representation of binary trees use?

= Array with pointers

In an extended binary tree, nodes with 2 children are called

= Internal node

Partition and exchange sort is ____________.

= quick sort

Which of the following is not a limitation of binary search algorithm?

= binary search algorithm is not efficient when the data elements more than 1500

These are binary trees with threads.

= Threaded trees

Sorting algorithm can be characterized as

= Both of the choices

__________________ is putting an element in the appropriate place in a sorted list yields a larger sorted
order list.

= insertion

The rearranging of pairs of elements which are out of order, until no such pairs remain.

= Exchange

TREE[1]=NULL indicates tree is _________

= Empty

Linked representation of binary tree needs ______ parallel arrays.

=3

Which of the following sorting algorithm is of the divide and conquer type?

= Merge sort

A connected graph T without any cycles is called a

= A tree graph

In a graph, if E=(u,v), it means

= u is adjacent to v but v is not adjacent to u


State True or False for internal sorting algorithms.

i. Internal sorting are applied when the entire collection if data to be sorted is small enough that the
sorting can take place within main memory.

ii. The time required to read or write is considered significant in evaluating the performance of internal
sorting.

= True, False

A connected graph T without any cycles is called

= no cycle graph

You might also like