637 Topics

Member Avatar for
Member Avatar for rhn94

I looked around quite a bit on how to solve this but i couldn't find a lot .. can anyone help me? The capitalized variables are constants [CODE] case '4': { bubbleSort(aList); string strKey; cout << " Input: "; cin >> strKey; binarySearch(aList, strKey); int binarySearchResult = binarySearch(aList, strKey); if …

Member Avatar for rhn94
0
248
Member Avatar for ChanelN19

hello, all! I am an absolute rookie in the world of C++ language, and not a good one either... I have an assignment to create a random number guessing game, and I am struggling with it. I have most of it done, but we have to generate the number of …

Member Avatar for frogboy77
0
323
Member Avatar for Gribouillis

This snippet defines a function walk() which generically performs a depth-first traversal of a tree, using preorder, inorder or postorder rules. Here, genericity means here that there are no hypotheses on what the tree nodes are or the implementation of the tree. Walk() only needs an arbitrary object used as …

Member Avatar for Gribouillis
2
1K
Member Avatar for Rubinder singh

[CODE]void inorder(struct node *r) { if(r!=NULL) { inorder(r->left); printf("\t %d",r->data); inorder(r->right); } }[/CODE] in the above code when the last element is reached i.e r->left becomes null then when inorder(r->left) is called it will send a null value to the function and if condition becomes false so the it'll come …

Member Avatar for mikrosfoititis
1
166
Member Avatar for Vonga

hi I'm new I got some questions about bubble-sort, so I registered here. I'm currently working on this program (bubble-sort) so I looked up some example codes and I found this here, which is practically the right thing I'm looking for. But I have some questions, like 1. How would …

Member Avatar for Vonga
0
134
Member Avatar for TrueCoding

Hi the aim of my program is to allow a user to enter the size of an array and then allows the user to enter the values into an array. The bit im having a problem with is I want to count how many odd and even numbers there are …

Member Avatar for Rushirl Quiño
0
2K
Member Avatar for JRDJ12

[CODE]package com.abc.text; public class StringProcessing { /** * Returns the number of non-null strings in the set. * If null or a zero-length array is passed in, then zero is returned. * If a slot in the array is null, then it is ignored (not counted). */ public static int …

Member Avatar for JRDJ12
0
466
Member Avatar for JRDJ12

Can someone show me what bubble-sorting an int[] of { 5, 4, 3, 2, 1 } looks like? I have to place it inside [CODE]public class SortIntArray { // this method needs your code to be added to work public static void sort(int[] list) {[/CODE] with no calls to any …

Member Avatar for NormR1
0
260
Member Avatar for theonebit

Hi, I would like some insigth or help on the following issue that i am facing. I am building an empty validation module. where i validate my bound item whether they are empty or or not before save. I have a tab control with the said bound items. The thing …

0
237
Member Avatar for JRDJ12

Hey all, I have an assignment that was assigned for the week that I could use some help on (not asking for someone to do it for me, just help with the step-by-step). Below is the requirements: 1) Create a new Java Project named whatever you'd like in your existing …

Member Avatar for stultuske
0
200
Member Avatar for sushlet

[CODE] ifstream in_gradebook; ofstream out_gradebook; in_gradebook.open("gradeBook.txt"); out_gradebook.open("gradeBook_edit.txt"); while (???) //while int is being read { in_gradebook >> score; out_gradebook << score << " "; sum = sum + score; } average = sum / 10.0; out_gradebook << average << endl;[/CODE] Here is a small snippet of the code I have …

Member Avatar for sushlet
0
243
Member Avatar for baldwindc

Hi, I am tasked with writing selection sort in assembly. We are writing for the ARM processor. Currently, this is what I have: [CODE] sort2: 73 stmdb sp!, {v1-v5, lr} @ Copy registers to stack 74 ldrb r5, [a2] @ J = n 75 76 ldrb v2, [a1] 77 cmp …

0
389
Member Avatar for sdragon

Hi Everyone, I'm new here and also new in using Java. I want to make an iterator without using the default methods hasNext, hasPrevious. Here is what I've already done using the default methods: [CODE]import java.util.*; public class HomeIterator{ public static void main(String[] args) { int i = 0; ArrayList …

Member Avatar for sdragon
0
269
Member Avatar for javaNooblet

Hi All, I am currently trying to figure out to finish this project. Below is my code that I have so far. There are some blank methods that I am not sure where to even begin on how to complete them. I have a description of what the methods should …

Member Avatar for NormR1
0
2K
Member Avatar for andy106

Hi i have a foreach loop, but it is just showing everything in one long line, so I wanted to put it in a table like this <table> <tr> <td>data1</td> <td>data2</td> <td>data3</td> </tr> <tr> <td>data4</td> <td>data5</td> <td>data5</td> </tr> </table> here is my loop: [CODE]<?php foreach( $products as $product ) { …

Member Avatar for pritaeas
0
1K
Member Avatar for megatron21

I am having hard time understanding what the problem is with my code here. Basically I have a map that contains Key objects as the key, and Block* as the value. The point of this for loop is to print out the values that the key contains on to the …

Member Avatar for megatron21
0
252
Member Avatar for shenanigans902

Hi, I keep getting the error message "Missing return statement" after my if else controls. I have return controls, I'm just not sure if I can implement multiple returns. For example, I am trying to create a method in which the middle value of a sequence of numbers is returned, …

Member Avatar for thines01
0
1K
Member Avatar for dolfan55aj

I'm trying to do an analysis of buildHeap vs. inserting an array of n values one at a time into a heap. I have a random case, best, and worst case. I was wondering if anyone knows what would actually be in an array to make the best and worst …

Member Avatar for raptr_dflo
0
376
Member Avatar for George_91

I've this code. I need to do several experiments to obtain de average time it takes to do some methods. Instead of re-running and re-running the program, I want to put a segment of the code in a FOR bucle. The problem is that my program never ends,it stays looping …

Member Avatar for vishwanath.m
0
166
Member Avatar for wolfgangcs

Trying to make a short to do list. show item to do-->click who you are $who and $item sends to top to show that item no longer there, but the rest are [CODE] <? echo "Here is the list of things that need to be done!"; echo "<form>"; while($row3 = …

Member Avatar for jmichae3
0
256
Member Avatar for C++newbie chick

Hello guys, I've tried searching the internet on how to cout a struct in an array via a binary search, but with no success. I've only learned how to do a linear search and I sort of understand how to do a binary search but: how do I cout the …

Member Avatar for C++newbie chick
0
2K
Member Avatar for kytro360

I have a listbox filled with different items. For each item in the list it will visit a site in the web browser, the user using the software fills out text on the page, then it moves down the list. How can I make it so it iterates down the …

Member Avatar for zachattack05
0
233
Member Avatar for challarao

Hi.... I wrote a program for Quick Sort algorithm.... It is compiled fine....but it is giving a run time error i.e., Segmentation Fault.... I tried hard but couldn't find out what is that thing causing segmentation error in this program.... Please help.... I'm getting segmentation fault very frequently (i'm using …

Member Avatar for challarao
0
456
Member Avatar for greenq

I am implementing Selection sort in doubly - linked list. I have to sort list by surnames by finding smallest element and inserting it into beginning of the list But there are some troubles when I run my program I have NIL exception in Sort Method in while loop. Help …

Member Avatar for Taywin
0
2K
Member Avatar for RoqueyB

I am supposed to have a while loop that asks for a number until the number is a negative. Then I am supposed to get a total of all of the numbers EXCEPT the negative number. As of right now my program adds up the absolute value of all the …

Member Avatar for TrustyTony
0
154
Member Avatar for C++newbie chick

Hello guys, I'm trying to make it so that the user can opt to change student's course code or credit points (they can choose to change neither, either or both) in case 5 of my main switch statement. The problem is, the loop doesn't end after you choose to do …

Member Avatar for Ancient Dragon
0
311
Member Avatar for joshThtch

Building a phonebook program for school--very much a work in progress. I still need to write a sort function, tweak my delete function, etc. But actually what I'm hoping you folks could answer is hopefully simpler--for some reason I seem to have a while loop that is executing twice, and …

Member Avatar for joshThtch
0
214
Member Avatar for fox196

Hi, I'm getting segmentation fault errors when I use quicksort with ~350 000+ numbers. This is the quick sort algorithm I'm using: [CODE]void swap(int* v, int i, int j) { int tmp = v[i]; v[i] = v[j]; v[j] = tmp; } int partition(int *v, int s, int e) { int …

Member Avatar for raptr_dflo
0
1K
Member Avatar for effBlam

Im having a main function issue. My program is a text analyzer of more than several lines and then input 'END' to stop taking input. It analyzes input text based on the chosen options 1 through 2, relooping for invalid choice. Im having an issue having it properly work in …

Member Avatar for Greeky
0
223
Member Avatar for ilovejava

so this is the assignment Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a and …

Member Avatar for Taywin
0
675

The End.