Untitled Deck Flashcards

1
Q

What is the time complexity for the queue operations (enqueue and dequeue) for a singly linked list with head and rear pointers?

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the time complexity for inserting and deleting in an ordered singly linked list with a head pointer?

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In the worst case, what is the time complexity for insert and delete operations in a binary search tree with a root pointer?

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the time complexity for the stack operations (push and pop) using a singly linked list with a head pointer?

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

If a list can be traversed forward and backward, what type of linked list is it?

A

A doubly linked list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the complexity to delete a node from the end of a linked list?

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How many pointers must be modified to delete a node from the end of a circular linked list?

A

1 pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How many pointers must be modified to delete a node from the middle of a doubly linked list?

A

2 pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How many pointers must be modified to delete a node from the beginning of a singly linked list?

A

1 pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When does stack underflow occur?

A

When the stack is empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In the context of function calls, when does a function become tail recursive?

A

Whenever there is a pending operation to be performed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which data structure is used to convert an infix expression into a postfix expression?

A

A stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which data structure is appropriate for processing batch computer programs submitted to the computer centre?

A

A priority queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the typical time requirement for enqueue and dequeue operations in a linked queue?

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In an input-restricted deque, where can insertions and deletions take place?

A

Insertions can be done only at one end, while deletions can be done from both ends

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

If operating system interrupts need to be handled in the order of arrival, which queue is appropriate?

A

A FIFO (First-In-First-Out) queue

17
Q

When is a binary tree T considered an extended binary tree?

A

When each node in T has either no children or exactly two children

18
Q

What do we call nodes at the same level that share the same parent?

19
Q

What is the maximum number of nodes at the kth level of a binary tree?

20
Q

Which traversal algorithm is used to extract prefix notation from an expression tree?

A

Pre-order traversal

21
Q

What is another name for a two-way threaded binary tree?

A

A fully threaded binary tree

22
Q

In a threaded binary tree, if the thread appears in the right field, what does it point to?

A

The in-order successor of the node

23
Q

In splay trees, which operations perform rotation?

A

The zig and zag operations

24
Q

When does the zig operation occur in a splay tree?

A

It happens when the parent of the node (P) is the root of the splay tree

25
Q

What does int **e; declare?

A

A variable e that holds the address of an integer pointer variable of three stars

26
Q

How many bytes are typical for memory addresses?

A

4 bytes or 8 bytes

27
Q

Which base is often used to print memory addresses?

A

Base 16 (hexadecimal)

28
Q

With 4 bits, which range of positive integers can be represented?

29
Q

How can a number in base b be represented in digit form?

A

As b₃ b₂ b₁ b₀

30
Q

What is the result of the bitwise operation 0101 | 1010?