Data Structures 2

Ace your homework & exams now with Quizwiz!

Every call to a recursive function has its own code and its own set of ____ and local variables.

Parameters

The operation ____ is used to remove the top element from the stack.

Pop

The ____ operation is used to add an element onto the stack

Push

A doubly linked list is a linked list in which every node has a next pointer and a ____ pointer.

Back

A doubly linked list can be traversed in ____ direction.

Either forward or backward

Building a linked list forward places the item to be added at the ____ of the linked list.

End

A doubly linked list is a linked list in which every node has a next pointer and a null pointer.

False

In a doubly linked list, every node contains the address of the next node except for the ____ node.

Last

A sequence of number such as 1, 1, 2, 3, 5, 8, 13, 21, 34, ... is called a ____ sequence

Fibonacci

In a linked list, we always want head to point to the ____ node.

First

A queue is a ____ data structure.

First in, First out

Stack is ______

First in, last out

The link component of each node is a pointer.

True

To access the fifth element in a list, we must first traverse the first four elements.

True

____ lists have elements that are in no particular order.

Unsorted

Stacks are restricted versions of _________

arrays and linked lists

A(n) ___ definition is a definition in which something is defined in terms of a smaller version of itself.

recursive

An algorithm that finds the solution to a given problem by reducing the problem to smaller versions of itself is called a(n) ____.

recursive algorithm

Given a pointer to a list, the function ____ prints the elements of the list in reverse order.

reversePrint

. A ____ is a data structure in which elements of the same type are added at one end and removed at another end.

Queue

Whenever a system is modeled on the First In First Out principle, ____ are used.

Queues

The process of solving a problem by reducing it to smaller versions of itself is called ____.

Recursion

In an ordered linked list, the search algorithm is somewhat improved because the list is ____.

Sorted

The address of the first node in a linked list is stored in a separate location/pointer, called the head.

True

. A linked list is not a random access data structure such as a(n) ____.

Array

A stack can be implemented as _____

an array or linked list

A binary search can be performed only on ____.

ordered lists

Because all the elements of a stack are of the same type, you can use a(n) ____ to implement a stack.

Array

The ____ attempts to find solutions to a problem by constructing partial solutions and making sure that any partial solution does not violate the problem requirements.

Backtracking algorithm

A ____ case is the case for which the solution is obtained directly.

Base

Building a linked list backward places the item to be added at the ____ of the linked list

Beginning

The header node is placed at the ____ of a list.

Beginning

A linked list in which the last node points to the first node is called a ____ linked list.

Circular

Building a linked list backwards places the new item to be added at the end of the linked list.

False

Building a linked list forward places the new item to be added at the beginning of the linked list.

False

Operations such as search, insert, and delete require a linked list to be sorted.

False

The algorithms to implement the operations search, insert, and remove are the same for sorted and unsorted list.

False

To delete a given item from an ordered linked list, there may be no need to search the list to see whether the item to be deleted is in the list.

False

The address of the first node in the list is stored in a separate location, called the ____.

Head

Because initially the list is empty, the pointer first must be initialized to ____.

NULL

A linked list is a collection of

Nodes

Searching through a linked list or inserting an item in a linked list may require a ____ of the list.

Traversal

Each node of a singly linked list has at least four components.

True

Every node in a linked list has two components: one to store the relevant information and one to store the address.

True

In a doubly linked list, every node contains the address of the next node (except the last node), and every node contains the address of the previous node (except the first node).

True

Sequential and binary search algorithms are called ____ search algorithms.

comparison-based

The function ____ makes an identical copy of a stack.

copyStack

When we check the array locations t, (t + 1) % HTSize, (t + 2) % HTSize, . . ., (t + j) % HTSize it is called the____ of the hash table.

hash value

A function that calls another function and eventually results in the original function call is said to be ____recursive.

indirectly

The operation ____ reinitializes the stack to an empty state.

initializeStack

The ____ operation checks whether the stack is empty.

isEmptyStack

The queue operation ____ determines whether the queue is full.

isFullQueue

The ____ operation checks whether the stack is full.

isFullStack

A(n) ____ is a list of items, called nodes, in which the next node is determined by the address, called the link, stored in each node.

linked list

In ____, the data is stored within the hash table and no linked structure is used

open addressing


Related study sets

Social Psychology Exam 3 Quiz Questions

View Set

AP Gov: Nominations and Campaigns (Unit 9)

View Set

Chapter 12: Leaders and leadership

View Set

Quiz 3 Chapter 3 "Business Ethics and Social Responsibility"

View Set

Chapter 3 Decision Structure (Review)

View Set