Questions tagged [traversal]

Traversal is the action of iterating over all the elements in a sequence of elements.

Traversal, in the context of programming languages, usually refers to the act of visiting all the elements in a sequence of elements - be it an array, a set, a list, or any other data structure.

Examples: Tree Traversal

2003 questions
0
votes
1 answer

how to limit query in OrientDB by two input params

I've got the following structure in DB: class(V): @city (Name, X, Y) class(V): @route(Name) class(V): @Alternative_Route(Name) extends from @route class(E): @has_route_to class(E): @has_subroute The Edges are connected to the Vertices like this:…
0
votes
1 answer

Node tree traversal with right and left child access

Trying to traverse a tree and getting null value for my array. I need to traverse the tree that only allows access to the right and left children with no root in the class definition for the Node class. class Tree { Tree(T x) { value = x; …
April_Nara
  • 1,024
  • 2
  • 15
  • 39
0
votes
1 answer

Something wrong with my Invert tree or BFS traverse?

I had already attached two tree to test, but the answer below is weird. Input are two trees and to check if they are inverted version. So i wrote a invert function and a BFS traverse to store the tree node into a String, through comparing the two…
Richard
  • 25
  • 1
  • 8
0
votes
1 answer

Use case of different traversal order in binary tree

There are preorder, inorder and postorder traversal for a binary tree, but no matter what order, it just traverses the tree to find a matched path. Is there any use case where I have to use any of the orders? Or are they just different ways but no…
jack
  • 1,787
  • 14
  • 30
0
votes
1 answer

Error trying to traverse an array in Eiffel

I get an error unknown identifier 'start' my code: visit_table(table: ETABLE) local t_array: ARRAY[ARRAY[ELEMENT]] b_header: BOOLEAN row_index: INTEGER do t_array := table.t_array b_header :=…
0
votes
0 answers

FTW does not give "newest" directory

I have the following C code: #include #define MAXPATHLEN 100 static time_t createtime = 0; static char ftwpath[MAXPATHLEN]; [...] ftw(somepath, get_writedir, 10); if (ftwpath[0] == '\0') { //Code assuming that the directory does not…
TacoVox
  • 141
  • 10
0
votes
2 answers

Traverse transitive keys in Map

I have Map which contains elements like: {“a”=”b”, “b”=”c”, “c”=”d”, “z”=”y”, …}. I need a method: List getTransitiveKeys(String startKey);// assuming the map is visible somehow as `map` When getTransitiveKeys(“a”) is…
卢声远 Shengyuan Lu
  • 31,208
  • 22
  • 85
  • 130
0
votes
2 answers

How can i manipulate every object im creating? Three.js

Im creating a scene using three.js and im adding 3 spheres to it. Then im trying to switching all spheres created from wireframe to non-wireframe material. I not using scene.traverse() because i have more objects on my scene and i only want to…
0
votes
3 answers

Traversing the DOM, getting text with highest appearance and add a class to the parent

I am traversing this DOM:
  • most occurring text
  • some text …
user6221709
0
votes
0 answers

About how to make xml file for html which is in local folder

I'm looking for its way to make xml. Though I tried it by web services below, I couldn't. sitemapxml.jp https://www.xml-sitemaps.com I inputed My ipadress like this. Ex.) http://192.188.100.100/pdt/index.html ↑It's not true address because I don't…
Helpful
  • 11
  • 6
0
votes
1 answer

Recursion mess while checking object properties

I have an object which could be nested as deep as possible. I'm trying to determine if object's property ready has at least one false value. If so the checkForFalse function should return false. I got confused while using recursion to solve this…
tawreon
  • 184
  • 12
0
votes
0 answers

Why does some binary tree traversal functions take a double pointer?

I was reading about trees and a possible implementation of the 3 traversal functions (from : Data Structures Using C and C++). The Node struct is : struct node { int info; node* left; node* right; }node; typedef struct node * nodeptr…
lastmaj
  • 146
  • 2
  • 8
0
votes
1 answer

Javafx and fxml button not clickable

I have a mixed up codes where I am building a program using Scene Builder with Splash Screen. I built a button on a TitledPane on top of Anchor Pane which is root. I set the fx:id and when I run, I cannot click anything. Not even a tab from titled…
user7693152
  • 9
  • 1
  • 5
0
votes
1 answer

Using pointers to traverse multidimensional array column by column

I have a 15x15 array which I have to traverse with pointers (hw ). I'm writing a puzzle solver and I need to search some words vertically,I've done horizontal search but I can't traverse the array column by column.I am trying to assign ptr to tmp…
0
votes
1 answer

Cannot read property 'top' of null

I'm console.logging the offset() of an element and I get left: 1236 top: 139 __proto__: Object But when I log offset().top I get the error Cannot read property 'top' of null Here's my code in its…
Aen Tan
  • 3,305
  • 6
  • 32
  • 52