A heuristic technique is not guaranteed to be optimal, but which is nevertheless sufficient for reaching an immediate, short-term goal, with a satisfactory solution. Examples of such: Trial and error, Rule of thumb, Educated guess, Intuitive judgment, Guesstimate, Profiling, Common sense. More concrete examples are: * Sorting and prioritizing isContinue Reading

RRT is a searching algorithm  applied by building a space filling tree  from samples drawn randomly of high-dimensional search spaces . import networkx as nx import numpy as np from sklearn.neighbors import KDTree class RRT: def __init__(self,x_init): self.tree = nx.DiGraph() self.tree.add_node(x_init) def nearest_neighbour(x_rand,rrr): dist=1000 x_rand = np.array(x_rand) for node inContinue Reading

Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Example 1: Input: [“flower”,”flow”,”flight”] Output: “fl” Example 2: Input: [“dog”,”racecar”,”car”] Output: “” Explanation: There is no common prefix among the input strings. Note: All givenContinue Reading