Computer Science & IT

Download Q&A
Q. In a singly linked list, how do you find the middle element?
  • A. Traverse the list twice
  • B. Use two pointers
  • C. Count elements first
  • D. Use a stack
Q. In a singly linked list, how do you insert a new node at the beginning?
  • A. Create a new node and point it to the head
  • B. Point the head to the new node
  • C. Insert at the end
  • D. None of the above
Q. In a singly linked list, how do you reverse the list?
  • A. Swap elements
  • B. Use a stack
  • C. Iterate and change pointers
  • D. Use recursion
Q. In a singly linked list, what is the time complexity of inserting a new node at the beginning?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a singly linked list, what is the time complexity to insert an element at the beginning?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a stack implemented using an array, what happens when you try to push an element onto a full stack?
  • A. The element is added
  • B. The stack overflows
  • C. The stack shrinks
  • D. The element is ignored
Q. In a stack implemented using an array, what is the time complexity of the push operation?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a stack, what happens when you try to pop an element from an empty stack?
  • A. Returns null
  • B. Throws an exception
  • C. Returns 0
  • D. Does nothing
Q. In a stack, what is the result of the operation 'push(5)', followed by 'push(10)', and then 'pop()'?
  • A. 5
  • B. 10
  • C. Both 5 and 10
  • D. Stack is empty
Q. In a stack, what is the time complexity of accessing the top element?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a stack, what is the time complexity of checking if it is empty?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a stack, what is the time complexity of the 'top' operation?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a stack, what is the time complexity of the pop operation when implemented using a dynamic array?
  • A. O(1)
  • B. O(n)
  • C. O(log n)
  • D. O(n^2)
Q. In a stack, what will be the output of popping an element from an empty stack?
  • A. Null
  • B. Error
  • C. 0
  • D. Undefined
Q. In a stack, what will be the result of popping an element from an empty stack?
  • A. Return null
  • B. Throw an exception
  • C. Return 0
  • D. Return -1
Q. In a stack, which operation is performed in constant time?
  • A. Push
  • B. Pop
  • C. Peek
  • D. All of the above
Q. In a stack, which operation is performed last?
  • A. Push
  • B. Pop
  • C. Peek
  • D. None of the above
Q. In a stack, which operation is used to remove the top element?
  • A. Enqueue
  • B. Dequeue
  • C. Push
  • D. Pop
Q. In a subnet mask of 255.255.255.0, how many usable IP addresses are available?
  • A. 254
  • B. 256
  • C. 512
  • D. 1024
Q. In a subnet mask of 255.255.255.192, how many subnets can be created from a Class C network?
  • A. 2
  • B. 4
  • C. 8
  • D. 16
Q. In a subnet with a subnet mask of 255.255.255.248, how many usable IP addresses are there?
  • A. 2
  • B. 6
  • C. 8
  • D. 14
Q. In a supervised learning context, what is cross-validation used for?
  • A. To increase the size of the training dataset
  • B. To evaluate the model's performance on unseen data
  • C. To reduce the dimensionality of the dataset
  • D. To cluster the data points
Q. In a switched network, what is the primary function of a switch?
  • A. To route packets between different networks
  • B. To connect devices within the same network
  • C. To provide a firewall
  • D. To manage bandwidth
Q. In a tree structure, which traversal method is typically used for searching?
  • A. BFS
  • B. DFS
  • C. Both BFS and DFS
  • D. Neither BFS nor DFS
Q. In a tree, which traversal method is equivalent to a level order traversal?
  • A. DFS
  • B. BFS
  • C. In-order
  • D. Pre-order
Q. In a weighted graph, if all edge weights are equal, which algorithm can be used to find the shortest path?
  • A. Dijkstra's algorithm
  • B. Breadth-First Search
  • C. Depth-First Search
  • D. A* algorithm
Q. In a weighted graph, if all edge weights are equal, which algorithm can be used instead of Dijkstra's?
  • A. Depth-First Search
  • B. Breadth-First Search
  • C. A* Search
  • D. Bellman-Ford Algorithm
Q. In an AVL tree, what is the balance factor of a node?
  • A. Height of left subtree - height of right subtree
  • B. Height of right subtree - height of left subtree
  • C. Number of nodes in left subtree - number of nodes in right subtree
  • D. Height of the node itself
Q. In an AVL tree, what is the maximum height difference allowed between the left and right subtrees?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Q. In an AVL tree, what is the maximum height difference between the left and right subtrees of any node?
  • A. 0
  • B. 1
  • C. 2
  • D. 3
Showing 331 to 360 of 3237 (108 Pages)
Soulshift Feedback ×

On a scale of 0–10, how likely are you to recommend The Soulshift Academy?

Not likely Very likely