Question 21Asked in Bihar STET Paper 2 Computer Science (Class 11-12), 12 Sep 2023, Shift 1

Which traversal algorithm is typically implemented using a stack data structure?कौन-सा पथक्रमण एल्गोरिदम आमतौर पर स्टैक डेटा संरचना का उपयोग करके कार्यान्वित किया जाता है?

कौन-सा पथक्रमण एल्गोरिदम आमतौर पर स्टैक डेटा संरचना का उपयोग करके कार्यान्वित किया जाता है?
  1. ADFSDFS
  2. BBFSBFS
  3. CBoth DFS and BFSDFS और BFS दोनों
  4. DNeither DFS nor BFSन तो DFS और न ही BFS
Show answerHide answer

Correct answer: (A) DFSDFS

Explanation

DFS goes deep before backtracking, so it uses a stack (explicitly or through recursion). BFS uses a queue.DFS लौटने (backtrack) से पहले गहराई तक जाता है, इसलिए यह स्टैक (सीधे या रिकर्शन से) का उपयोग करता है। BFS क्यू (queue) का उपयोग करता है।

From Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 1

This is question 21 of Bihar STET Paper 2 Computer Science (Class 11-12) PYQ, 12 Sep 2023, Shift 1. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.