76 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for Yao889956

Greedy algorithm is an algorithm based on the greedy approach, which is commonly used to find the globally optimal solution by selecting the locally optimal solution at each step, considering the given constraints. The application of the greedy algorithm in computer monitoring software can include several aspects: File scanning: When …

Member Avatar for rproffitt
0
82
Member Avatar for midyajai

I am trying to understand Boyer Moore algorithm & KMP algorithm (Knuth Morris Pratt)? I tried some places like GeeksForGeeks, TutorialsPoint etc. But I have still some doubts. If you guys have some resources or videos where these algorithms are explained in somewhat simple terms, please share them. First I …

Member Avatar for Alisha_8
-1
708
Member Avatar for venanciodayao18
Member Avatar for Dani
0
204
Member Avatar for ytgaamer

I am making a tic tac toe game, and have completed it. Now I am trying to implement a library to my code and I chose ncurses, because it seems easier to add and will allow me to change the color of the input for the game. However, I can't …

Member Avatar for rproffitt
0
146
Member Avatar for faarrukhjamal

I tried alot to print this arrow with random generated values which are 0101 , every time it should be differnt, please help me out thanks :) ![Untitled1.png](/attachments/large/4/c843d1e3a2cf1464dc1f1eb7c0d4a68a.png)

Member Avatar for Smartfitness33
0
1K
Member Avatar for chrisschristou

hello, i just set goal of mastering algorith and i just get started i have an algorhtm for insert sort and i when i write it in c it is not sorting this is the algorith for j D 2 to A_length key = A[j] // Insert A[j] into the …

Member Avatar for rproffitt
0
415
Member Avatar for Dhelandel
Member Avatar for JamesCherrill
0
259
Member Avatar for i.

I have a problem with my pseudocode: Declare Integer p1 Declare Integer p2 Declare Integer p3 For p1 = 1 To 3 For p2 = 65 To 66 For p3 = 6 To 8 Display p1, p2, p3 End For End For End For This would display 18 combinations. But, …

Member Avatar for AssertNull
0
367
Member Avatar for quatrosem

There is a problem of facility location that I solve with genetic algorithms. I can get good results. So I would like to compare my genetic algorithm complexity O(n^2) with the brute force algorithm. But I am not getting an answer. (n = number of individuals in my population, usually …

Member Avatar for Gribouillis
0
466
Member Avatar for cproger

I am writing a code for a user to choose numbers in a progress bar. For some reason the progress bar does not fill up or empty when the int progress is not exact. For example: The progress bar value is 5 at the moment. The user chooses 250 Million …

Member Avatar for cproger
0
250
Member Avatar for BabaRoro

Hi all , i want to cast the output of fuzzy logic algorithm into any another type (float , int ,double..), i tried this with usual methods but there is no change.. This is the complete java code public static void main(String[] args)throws Exception { String filename = "output.fcl"; FIS …

Member Avatar for BabaRoro
0
297
Member Avatar for marcolanza24

Hi Everyone, I have a project from school which is a console application that takes hard-coded items and process those inside of one of my custom class which intherit from a list of strings. Then, it processes those items and apply the Apriori Algorithm (I cannot use any existent package …

Member Avatar for Raul Perez
0
326
Member Avatar for jo386

Hello all. I apologize in advanced if this has been asked before but I have not been able to find this information via google or searching here. Everything I found is related to how a for loop works. I know how to use a for loop in python and what …

Member Avatar for rproffitt
0
283
Member Avatar for Jamie_11

This is what I have so far.....any advise? Output does not give only one largest and smallest number from a file and also there are multiple averages of numbers..... thank you in advance.

Member Avatar for stultuske
0
200
Member Avatar for kouty

Hello. I want to submit a code stuff with an explanation. It is not a valid code. Someone can help me to find error? <code> ** ** I'm trying to build a program that change numbers writen in decimal notation. If we consider each ranges of numbers: unities, 10-es, 100-es …

Member Avatar for kouty
0
643
Member Avatar for nathan.pavlovsky

Hello all! I am trying to take a string that has mixed uppercase and lowercase chars and then convert it to lowercase. I am doing the following line of C++ code: transform(theReadMessage.begin(),theReadMessage.end(),theReadMessage.begin(),theReadMessage.end(),::tolower); //theReadMessage is a string to convert to lowercase and my C++ xCode debugger gives me this message `Too …

Member Avatar for nathan.pavlovsky
0
715
Member Avatar for bijutoha

Yes I'm too worry about this Update. Because my website still not responsive. Could anyone say something please, This **21st April Google Algorithm update** will penalize non-mobile friendly websites? I'm waiting for your valuable response.

Member Avatar for advent_geek
0
351
Member Avatar for zrd0808

This is a homework problem; however I just want some direction. I have to write a module graph.cpp that implements djikstra's algorithm. so far i am at the reading in module and am trying to make an array of structures. here is the code. [code=c] // Zachary Dain // CSCI …

Member Avatar for Schol-R-LEA
0
436
Member Avatar for nathan.pavlovsky

Hello programmers! I have been working on STL algorithms for some time now as a beginner, and I started doing an exercise, among which is the task of `use the fill algorithm to fill the entire array of strings named items with "hello"`. My code for this is below: // …

Member Avatar for nathan.pavlovsky
0
1K
Member Avatar for tapananand

I guess most of you would have seen the algorithm for the following problem: **Input:** Set of intervals(time) **Output:** Partion of intervals into minimum subsets such that no interval in a subset overlaps. **The Algorithm:** Sort intervals by start times and look them in this order, put each interval in …

Member Avatar for tapananand
0
290
Member Avatar for Rootz

When I try to compile my code in visual basic 2010 it gives me the error 1903 and when I compile the code in Code::Blocks it opens the standard template library's algorithm.h file and takes me to line 2163 if (*__i < *__first) I don't want to modify anything here, …

Member Avatar for Rootz
0
820
Member Avatar for Labdabeta

Hello, I recently took a course on assembler/compiler construction. In it we covered parsing algorithms such as LL(n), LR(n), LALR(n), and SLR(n). I understand how these parsing algorithms can be used to determine **if** an input string follows a context free grammar (CFG). At some point I also understood how …

Member Avatar for Labdabeta
0
283
Member Avatar for castajiz_2

There was a user named Mitja Bonca wich spent a lot of his time on the C# section. Before a year ago i ve seen a algorithm that he did for a guy providing him help in that way. This algorithm was tremendous (was then) and i can t locate …

Member Avatar for castajiz_2
0
237
Member Avatar for ezkonekgal

hello. I need some help on our implementation on lines of code program. here's the algorithm we have: 1. The LOC program will start by asking for the filename of the program to be counted. 2. Browse for the filename of the program to be used. 3. The contents of …

Member Avatar for emoon11
0
2K
Member Avatar for TalentedIndividual

hello fellow programmers, i am doing an assignment for class and i am having a bit of trouble. So the assignments reads Given two sorted (in ascending order) lists of size M and N, write an O(M+N) algorithm to find the sorted (also in ascending order) union of the two …

Member Avatar for tinstaafl
0
518
Member Avatar for pwolf

At the moment I am trying to decide which book to buy, there are many that I think would be very interesting, but some are most likely beyond me. The books in my list, along with my thoughts on them are: Concrete Mathematics (I believe this is probably too advanced …

Member Avatar for john alternate
0
371
Member Avatar for Labdabeta

Hello, As may be apparent from my previous posts, I am in a "If its worth doing, its worth overdoing" sort of competition with a friend of mine. Our goal is arbitrary precision integer arithmetic. I think I am close to getting the data storage working, but now I want …

Member Avatar for Labdabeta
0
976
Member Avatar for Labdabeta

Hello. I was reading http://xkcd.com/287/ while bored and thus decided to write a program that would solve such np complete problems. Here is what I got: #include <iostream> #include <vector> using namespace std; template <typename T> T NPMenuProblem(T desired, vector<T> options, vector<T> &ret) { vector<T> save=ret; T remainder; T min=desired; …

Member Avatar for Labdabeta
1
202
Member Avatar for dan.gerald

I am having problem on removing root, moving the lastnode to the new root and applying the downheap. Here is my code snippet #include <iostream> #include "heap.h" heap::heap() { data=new myvector<heapData> (10); size=0; heapData item; item.key=0; item.data=0; insertItem(item); } heap::~heap() { delete data; }; void heap::insertItem(heapData item) { data->insertAtRank(size,item); size++; …

Member Avatar for buterous
0
492
Member Avatar for nah094020

alright guys so am havign trouble finding a way to search for seats that are toghether, my pgram consists of a theater with 20 x 10 seats, i have created a seatSelection class and the theater file which has the main. Ok so heres a sample output of how it …

Member Avatar for nah094020
0
756

The End.