---
title: "Which search method takes less memory?"  
description: "Which search method takes less memory?"  
author: "Khushi Kapoor"  
published: 2017-11-25  
updated: 2026-04-15  
canonical: https://answers.mindstick.com/qa/31198/which-search-method-takes-less-memory  
category: "technology"  
tags: ["artificial intelligence"]  
reading_time: 4 minutes  

---

# Which search method takes less memory?

Which [search method](https://answers.mindstick.com/qa/31200/a-algorithm-is-based-on-which-search-method) takes less [memory](https://www.mindstick.com/blog/300050/what-causes-sudden-memory-loss)?

## Answers

### Answer by akriti kashyap

**[Search](https://www.mindstick.com/articles/65368/best-smo-services-company-in-hyderabad-improve-search-rankings) Method Holding On Less Memory!**

![Which search method takes less memory?](https://answers.mindstick.com/questionanswer/b90b1aa9-dc7b-468a-a1d8-c0d1e9965f19/images/62137020-5fb0-4bae-a278-9330f2b2e5d7.png)\

**Depth-First Search** is the traversal technique that occupies less space in memory. Well, this is fine if it takes less memory space but exactly it is… that is a question!

## Depth First Search (DFS):

![Which search method takes less memory?](https://answers.mindstick.com/questionanswer/b90b1aa9-dc7b-468a-a1d8-c0d1e9965f19/images/f4da9c86-5593-4b45-95fb-aea284f2fbad.png)**\**

It is an algorithm which is recursive in nature and uses the idea of backtracking. It involves all the possible searches that maybe exhaustive as it traverses through all the nodes and if required then it backtrack also.

Now, a new term is been tossed “**Backtrack**”, thus it can be explained as while traversing through the nodes, if we encounter with a node that is a child node, it steps backward from that node to find the next path that can be traversed. All the nodes would be visited on the current path, till the time every unvisited node is not been traversed, after that only can a next path be chosen.

Stating about its functionality, DFS can be implemented using stacks, which can be shown in the below code:

- Pivot the starting node and stack the rest of the adjacent nodes in the stack
- Pop a node from the stack to select the next node to traverse and Push all its adjacent nodes into the stack
- Continue, repeating this until the stack is empty. However, a mark is been made if the node is been visited wherein, this function would prevent you from visiting the same node again and again and if not then may you end up in the condition of infinite loop

## \

**Pseudocode:**\

```
DFS (G, s): //Where G is graph and s is source vertex       Let A be stack       A.push(s) //Inserting s in stack       mark A as visited.      while (A is not empty):          //Pop a vertex from stack to visit next           b = A.top( )          A.pop ( )          //Push all the neighbors of v in stack that are not visited         for all neighbors c of b in Graph G:            if c is not visited :                     A.push(c)                    mark c as visited DFS-recursive (G, s):         mark s as visited         for all neighbors c of s in Graph G:            if c is not visited:                DFS-recursive (G, c)
```

*Hope this would help you to get the info about DFS!*\

## Cheers!

### Answer by user

The wolf gold slot has a fixed jackpot of 5000 coins. The coin value can be set from 0.01 to 0.50, and the maximum bet per line is 5.00. The maximum bet per spin is 125.00. The game has a high return to player percentage of 96%.

http://wolfgoldslot.org/

### Answer by user

Have I used it before? Definitely. I once used DFS to efficiently map out dependencies in a large software project. It helped me identify potential circular dependencies quickly. Ever tried to implement AI in Basket Random using DFS to predict opponent moves? Seems like it could get tricky!

### Answer by user name

Discover the must-have features for success with Web Design Dubai in 2026. Learn how modern websites drive growth and customer trust.


---

Original Source: https://answers.mindstick.com/qa/31198/which-search-method-takes-less-memory

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
