#### Category : search

I’m trying to recursively search a character array for the first occurrence of a sequence comprised of another character array. I’m not allowed to use strings, predefined string functions, or loops. The character arrays that I’m searching in are names used in the program, and this function is used in another function that asks the ..

I want to implement binary search on my program but I also want to print the array step by step for each iteration e.g: Iteration 1: [9, 20, 11, 23, 4] Iteration 2: [11, 23, 4] Iteration 3: [23] anyone has any idea how to do it? Much appreciated! Source: Windows Que..

I’m doing a program for class what given a string obtain the longest substring made of a consecutive {consonant, vowel} pattern, but i was asked to do it in Divide And Conquer fashion. This is my algoritm but i dont know if it’s a D&V one. And if it isn’t, how do i modify it ..

I am trying to sort an array using Binary Search, but I don’t know why I am not getting the correct outputs. My code is- #include<bits/stdc++.h> using namespace std; int BinarySearch(int arr[], int l, int r, int x){ int mid = l + (r-l)/2; if(l<=r){ if(arr[mid] == x ){ return mid; } else if (arr[mid] ..

I’m a complete beginner so I hope you’d understand my coding style. I am trying to create a program in C++ that solves the 8 puzzle problem using A* search algorithm, with the Manhattan distance formula as its heuristic value. I’ve completed the setup and these are the two classes I created. class State { ..

I find it hard to visualize Floyd Warshall Algorithm.And here is why.We take 3 loops for (int k = 1 ; k <= n ; k++) for (int i = 1 ; i <= n ; i++) for (int j = 1 ; j <= n ; j++) if (dist[i][j] > dist[i][k] + dist[k][j]) dist[i][j] ..

I would like to print all files of a directory which contain a specific string multiple times in their name (not in the file itself). Is there a way to do this with Powershell? Source: Windows..