Queue and Linked Lists

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/34

flashcard set

Earn XP

Description and Tags

Queue and Linked Lists

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

35 Terms

1
New cards

is an n ordered list in which all insertions take place at one end, the rear, while all deletions take place at the other end, the front.  It is an example of a linear data structure.  

2
New cards

A queue is an n ordered list in which all insertions take place at one end, the ____, while all deletions take place at the other end, the ____.  It is an example of a linear data structure.  

rear

front

3
New cards

A queue has a ________ structure where elements can only be added to the rear of the queue and removed from the front of the queue. 

First-In, First-Out (FIFO)

4
New cards

A queue has two main operations, what are those?

  • enqueue for insertion and

  • dequeue for deletion.  

5
New cards

Queue operation for insertion?

Enqueue

6
New cards

Queue operation for deletion?

Dequeue

7
New cards

Queues are known as ________ lists.

First In First Out (FIFO)

8
New cards

Adds an item onto the end of the queue.

enqueue(new-item:item-type)

9
New cards

Removes the item from the front of the queue.

dequeue()

10
New cards

Returns the item at the front of the queue.

front():item-type

11
New cards

Returns the item at the front of the queue.

back()

12
New cards

True if no more items can be dequeued and there is no front item.

is-empty():Boolean

13
New cards

True if no more items can be enqueued.

is-full():Boolean

14
New cards

Pushes a new element on to the end of the queue.

push(newElement)

15
New cards

Removes (but does not return) the element at the front of the queue

pop()

16
New cards

Returns the number of elements in the queue

get-size():Integer

17
New cards

ENUMERATION: The following are operations involved in a circular array implementation of a queue.

  • Insertion at the rear of the array is constant time

  • Removal from the front is linear time

  • Removal from the rear of the array is constant time

  • Insertion at the front is linear time

18
New cards

In linked list implementation of queue, each node for a single-linked list would store a total of ___ references.

two

19
New cards

In linked list implementation of queue, each node for a double-linked list would store a total of _____ references.

three

20
New cards

TRUE OR FALSE

Linked-list implementations of queue require more storage because of the extra space required for the links.

TRUE

21
New cards

It is a linear data structure, in which the elements are not stored at contiguous memory locations.

LinkedList

22
New cards

The elements in a linked list are linked using _____.

pointers

23
New cards

A linked list consists of?

  • nodes where each node contains

    • a data field and

    • a reference(link) to the next node in the list.

24
New cards

A linked list consists of nodes where each node contains?

  • a data field

  • a reference(link) to the next node in the list.

25
New cards

ENUMERATE:

Three types of LinkedList:

  1. Singly Linked List

  2. Doubly Linked List

  3. Circular Linked List

26
New cards

It is the most common form of a Linked List where each node contains a data field and a single pointer to the next node in the list.

Singly Linked List

27
New cards

The reference to the first node in the list is called the ____ of the list.

HEAD

28
New cards

The ________ field contained in the node is used to traverse to the next node and to its next node and so on till we reach a node that points to NULL.

pointer/reference/link

29
New cards

This is the last node in the list.

a node that points to NULL

30
New cards

TRUE OR FALSE

Also, a singly linked list can only be traversed in one and only one direction i.e. from head to the last node. There is no way to traverse from the last node back to the head.

31
New cards

It is a linked data structure that consists of a set of sequentially linked records called nodes.

Doubly Linked List

32
New cards

In Doubly Linked List, each node contains how many fields?

two

33
New cards

In Doubly Linked List, each node contains two fields, called?

  • links

    • that are references to the previous and

    • to the next node in the sequence of nodes.

34
New cards

It  is a linked list where all nodes are connected to form a circle. There is no NULL at the end.

Circular Linked List

35
New cards

TRUE OR FALSE

A circular linked list can be a singly circular linked list or doubly circular linked list.

TRUE