Podcast
Questions and Answers
When implementing a stack using a linked list vs array, which statement is WRONG?
When implementing a stack using a linked list vs array, which statement is WRONG?
- For the push and pop functions, using array is much faster because otherwise a linked list always requires traversing to the node at the end
- A linked list is a better option in terms of flexible stack capacity without requiring memory copy
- It's possible to use the front of an array as the 'top' of the stack (correct)
- Stack implemented using a linked list has a slightly higher storage overhead comparing to array due to the additional 'next' variables in each node
Which of the following is WRONG for binary tree?
Which of the following is WRONG for binary tree?
- There's always one root node in a tree
- Each node can only have one parent node
- It can be traversed (visiting all nodes) in more than one ways.
- Each node always has two child nodes, except the leaf node which has none. (correct)
Which of the following is TRUE about implementing a stack using an array?
Which of the following is TRUE about implementing a stack using an array?
- It's not possible to implement a stack using an array
- The 'top' of the stack is always at the end of the array (correct)
- Push and pop operations require traversing the entire array
- An array is a better option in terms of flexible stack capacity without requiring memory copy
When implementing a stack using a linked list vs array, which statement is INCORRECT?
When implementing a stack using a linked list vs array, which statement is INCORRECT?
Which of the following is NOT true for binary tree?
Which of the following is NOT true for binary tree?
What is the main advantage of using a linked list over an array when implementing a stack?
What is the main advantage of using a linked list over an array when implementing a stack?
When implementing a stack using a linked list vs array, which statement is WRONG?
When implementing a stack using a linked list vs array, which statement is WRONG?
Which of the following is WRONG for binary tree?
Which of the following is WRONG for binary tree?
When implementing a stack using a linked list vs array, which statement is CORRECT?
When implementing a stack using a linked list vs array, which statement is CORRECT?