instruction stringlengths 71 71.9k |
|---|
I programmed a Tic Tac Toe game using JavaFX, and I'm looking for a code review of it to improve my skills and practices in Java. It would highly be appreciated if you reviewers emphasize on these points specifically:
Bad practices which I am following
Inefficiencies and how would I rectify them
TicTacToe.java:
packa... |
I'm building a spiking neural net (recurrent, integrate and fire), and I'm curious about how to reduce the warp divergence (and other problems) I may have.
Here's an example with a few hand-placed neurons and synapses for a better apprehension. I upload the whole code on a Git repo for faster access, make tui then ./cu... |
I'm just starting to learn Java and I have written this simple Tic Tac Toe game. Please review it and give me some feedback, advice, guidance etc.
Main method:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
char player='o';
int row,column;
Scanne... |
I'm kinda new to PHP and I'm trying to make a script to validate a HTML form only with PHP (I know there are options to do so with JS, but I guess it's better to have a "cover" with a server-side script).
Project folder structure:
project/
classes/ #contains classes to validate and process the HTML form
DB... |
I have written this program to remove the duplicates from an unsorted array. Please review and give me your input on how I can improve it a little more.
public static void main(String[] args) {
int[] arr = {4, 3, 4, 2, 6, 1, 1, 7, 6, 8, 9, 9, 1, 1};
// perform quick sort for o(n log n) time.
quickSort(arr... |
I have been trying my hand at Python lately. I have been able to look at code examples and create a custom application that queries a Microsoft SQL Server, pulls out two columns (date, balance) and charts them using pyplot embedded in tkinter for future development.
Because of the "chop and change" nature in which I wr... |
language-tags is my first crate, it is hosted on GitHub and I uploaded it to Crates.io. It parses language tags like en-US into useful parts, like language and region for example. These tags then can be compared or printed out again. To create language tags it provides the langtag! macro.
Is it good code, where can I i... |
Below is my implementation of Word Morph solver in Python.
The challenge consists of transforming one word into another word by changing one letter at a time. Each word in the chain should be an English word (part of a dictionary). One should output all such chains of the minimal possible length. Examples: 'tree' to '... |
Function:
char **strsplit (char source[])
{
char **strings = calloc(1, sizeof(char *));
int nStrings = 0, nChars = 0;
strings[0] = calloc(2, sizeof(char));
while('\0' != *source)
{
if(*source == ' ')
{
nStrings++;
nChars = 0;
strings = realloc(st... |
Problem: Write a method that takes in a string. Your method should return the most common letter in the array, and a count of how many
times it appears.
Note: I solved it with Ruby, but the solution will be almost the same with other OOP language which have arrays and hashes.
Solution:
Split the string into an a... |
I am developing a Python script that will process large amounts of data from an experiment. Files are read in, calculations are made, images are plotted and saved as .pngs, and calculated parameters are outputted to a .txt file.
When I save a file, the user is prompted if they want to overwrite any existing files. If ... |
This code takes a list of ints and sums their pairs, storing the summed pairs in an array sumPairs, then returning that array. If the supplied array toSum has an odd number of elements, it returns the sumPairs with the last element of the toSum as the last element of sumPairs. Any suggestions for improving my code, or ... |
Just looking for an initial steer on my AngularJS implementation.
Background
Started work on a clients new site which uses a popular CMS as the backend and AngularJS has been chosen as the client side framework.
Functionality
Build a simple control that will manage alerts generated from the CMS.
If the alert has bee... |
My assignment was to write a method that is capable of visiting each edge in a graph in each direction exactly once.
With it, I included a basic Graph class to test it with.
What I'd like a review of:
This is like my 1000th attempt after trying everything I could think of. This is the first version that I've had that ... |
I wrote some code to solve this question and I was wondering if it was efficient or not.
I just started learning code last week and I would like to get some input so I can get in the habit of writing the most efficient code possible.
#include <iostream>
using namespace std;
// What is the largest prime factor of the ... |
I have written an n-body simulator, implementing the Barnes-Hut algorithm. Please comment on anything you can see wrong with this.
Wikipedia Barnes-Hut page
This is a screen shot of the simulation 20 hours in. All the particles spawn in a uniform disk, given an initial velocity in order to "orbit" the "Galactic center... |
I am attempting to build a compiler for a stack-based (or concatenative) programming language in Haskell. I've done fine getting the lexer and parser up and running, but now that I'm into the meat of the semantic analyzer, implementing the algorithms idiomatically is getting trickier. I finally had to force myself to l... |
Problems:
Wanting to check all checkboxes when the checkbox w/id=checkall is checked.
Wanting to uncheck the "checkall" box when any other checkbox is unchecked.
Solution:
$(document).ready(function () {
$('#checkall').on('click', function () {
if ($(this).is(':checked')) {
$('input[type="checkbox"]').each(functi... |
I've created a short piece of code to determine whether or not various 2D shapes (circles/lines/rectangles) intersect. It was a job interview question, but now it's just about self-improvement.
I'd like any suggestions for how best (in terms of code cleanliness and scalability) to handle the fact that in implementation... |
I wrote up a small script to calculate the answer to Project Euler Problem 5:
2520 is the smallest number that can be divided by each of the numbers
from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all
of the numbers from 1 to 20?
I'm wondering if this algorithm... |
It is very messy and I lack the experience to make it eloquent so I wanted some help with it. The process time is also very slow.
Currently it goes into the first page and goes through the links in the index looking for the word "symptoms." If its not found it will look for a link inside that link named "faqs" and go t... |
I'm working with an existing code base here and while I don't have the time/budget to re-do the entire thing (ultimate solution), I do get a bit of leeway to enhance the code base, as well as maintaining it.
We're using EntityFramework and the SynchronizedBindingList is essentially just that; it keeps all the data in m... |
Few months ago I posted my code Getting a single value from the DB. I implemented suggested changes and this is how it looks like right now:
public class DataBase : Page
{
protected static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected static... |
I intend to populate some fields in a form based on some presets values. The user choose the presets from a list. The following code is working, but as I'm a newbie, I would like to know if I done it the proper way and if it can be improved.
Preset obj:
var obj = {
"preset_a":{
"input":{
"field_... |
My algorithm generates combinations of elements. For example, having [A, B, C ] creates the following combinations [ A ], [ B ], [ C ], [ AB ], [ AC ], [ B, C ], [ ABC ].
Unfortunately for items too large too long and too much memory space, I get java.lang.OutOfMemory thrown. How can I fix?
public void combine() {
... |
I am developing a server for a web-client. Basically it's just a simple CMS to modify some data. My problem is that I never had a project like this where I have to take care about the server and the client and of course everything that happens between those two.
I've started to implement a database with Hibernate which... |
I am trying to create a PHP / MySQLi wrapper class that uses prepared statements, the goal of the class is to create a connection to the Database, then INSERT / SELECT / UPDATE information from the database.
The class should hopefully be general enough to be able to use in multiple applications with other wrapper class... |
I am writing a macro to move data from a CSV to an excel template. Currently, I have the code set to search for a keyword in column A of the CSV, and extract data from specified columns in the keywords row. I would like to know if there is something I can do to simplify the code.
Public Sub MoveData()
'**defines ... |
The code works well but before I added sections (13) and (14), it ran in 6 minutes and now runs in 16 minutes. If there is a way to streamline this to cut down the runtime, that would be extraordinary.
Main part of code grabs values from under the header 'CUTTING TOOL' in various opening files in a designated folder. T... |
I'm reading serial data in binary format from a stream, and I'm not happy with how I extract the data because it takes so much operations to extract the binary data from a simple line of binary data.
Each line starts with a character indicating the type of data, and afterwards follow a few 16 bit integers (big endian),... |
I am creating a custom Exception class and trying to log the CallerFilePath, CallerMemberName and CallerLineNumber in the error log file along with the error message which is my main motive.
I am just wondering if it is a good way of doing this task or if there is a much better/cleaner way to raise/handle and note down... |
I found myself in need of a Readers-Writer mutex. With C++17 TR2 support not yet available in our compiler, I set out to implement std::shared_mutex so that we have an easy upgrade path to the STL implementation once we get C++17 support, rather than rolling my own API.
I put all classes intended to implement or suppl... |
I wrote a basic Python script that consolidates and customizes several popular adblocking hosts files. I was interested in making it more efficient if possible, and I'd like to improve my style and best practices.
import urllib.request
import re
import os
os.chdir('C:/Windows/System32/drivers/etc')
# This contains a... |
On my quest to become a master programmer I have created a simple game of Hangman, and so I thought I would upload it here and see how it could be refined.
One question I had was my use of exception handling. I tried to utilise it here, but I get the sense it might have been overkill. Should I only be using try/except ... |
I'm trying to create a caching solution used in various parts of a clients' application. The resulting code will be open source.
For example, it will be used for caching API queries like "get all users" or "get all projects", whatever "all" may mean to the consumer (the constructor accepts a lambda as a "getter functio... |
This is my sound system that allows for the following functionality:
One master volume that controls every sound.
A function to stop/pause every playing sound
A function to control every instance of a sounds volume(@creation)
A function to stop/pause every instance of the same sound
Sounds that are playing are kept i... |
For school we have to develop a product manager. The basic task is to add new products. A product has a name and a price.
I know the one or other class is currently pretty empty but its planned to add more methods.
The code is developed in MVC-format and comments plus texts are in German.
I would like to know what's go... |
For the community challenge, I wrote ultimatoe. For me, the most interesting part is clearly the AI, but what I did so far is just a stupid Monte Carlo tree search, which isn't ready for a review yet (but may come soon).
Before reviewing, please have a look at the README. The text is much shorter than the code.
I'd lik... |
I answered a question yesterday on SO based on this riddle, but the code was so hard to read/follow to actually understand what was going on it was easier to write my own code to test the scenario and debug the program.
I wrote it pretty fast, but I want to make sure the program I wrote is easy to follow and adheres t... |
I have the following task:
Create a simple treasure hunt game.
Create a two-dimensional array of integers 10 by 10. In a random
position in the array store the number 1. repeat Get the user to
enter coordinates where they think the treasure is. If there is a 1
at this position display ‘success’. Until they... |
I am learning OOP. I feel I have a grasp of basic dependency injection in that as a rule of thumb, you pass an object to a method rather than the parameters to create an object. As such, never create an object within a method, but use a factory. Right?
The code below is for connecting to a REST API. However, I feel am ... |
I created a standalone Java application that acts as a consumer that retrieves/listens for messages inside an ActiveMQ queue. Planning to run two instances of these on different machines for high availability purposes.
What bothers me is the usage of Connection, Session, MessageConsumer, and Transaction (Hibernate). I ... |
I've written some code to:
Parse an XML file.
Extract some strings.
Make copies of the original XML whose names are suffixed with the extracted strings.
Please review this.
from lxml import etree as ET
import re
def create_paramsuffix_copies(xmlfile):
NSMAP = {"c": "http://www.copasi.org/static/schema"}
pa... |
I have been working on a file parser that takes a very specific file format and parses it into a list that is arranged into node data and the neighbors that it relates to. I am new to Python (this is my very first program in this language), so I am not familiar with more advanced methods of solving the problem using Py... |
I need criticisms and refactoring advice for my controller code:
class ItemsController < ApplicationController
def new
end
def create
params = items_params
if not titles_and_urls_are_same_length(params)
render :new
end
collection = false
if params[:tit... |
I have started learning XML parsing in Java (currently reading Java & XML by Brett McLaughlin). Here is my first program to parse XML using SAX parser. Please review the code and let me know if that is correct way of parsing books.xml and storing into to a List<Book> (The code is working fine. I just want to ensure I'm... |
This is the first code I've written. It's for an intro to Java course. Could you look over it and let me know of things I could improve before handing it in?
For reference, I've also provided what I'm being graded on at the bottom.
import java.util.Scanner;
public class LB01Smith {
public static void main(String[... |
Link to previous question: Barnes-Hut N-body simulator
It still has issues I'm sure.
Node.h
#pragma once
#include <vector>
struct Body
{
double posX, posY; //position x and y
double velX, velY; //velocity x and y
double AccelX, AccelY; //force acting on object since last frame
f... |
Could somebody help me out with trying to clean up this big list of if / else if statements please? I've found that switch statements won't work because it won't handle a TextBox as the parameter. I've seen many answers involving the Dictionary, but those won't work either in my case.
private void SelectNextTextBox... |
I'm trying to implement Dijkstra's algorithm in Python, but the issue is that Python doesn't have support for key-based heaps out of the box, so applying relaxation step of the classical algorithm presented in CLRS becomes cumbersome.
My idea is to keep maintaining current total distance and then pushing frontier nodes... |
First of all, I would like to know if there is any difference (execution-time) in C between:
GET request made by using cURL
GET request make by using sockets (BSD sockets)
Second, I've done a C program which parses a XML file (without using any xml-specific library) and makes a GET request with the parsed info as it... |
I was writing class Player with private fields and getters and setters. But the number of methods started to grow, I used lists and maps so additionally I had to create methods to get size of them and every item by index, key and etc. I got tired and decided to use public fields instead of getters and setters. Addition... |
There are quite some questions and answers about how to make enum really type-safe and I didn't find a solution that ensures both type safety and valid values. So I took some ideas and extended it to my own generic solution, somehow resembling to enum classes used in some other languages.
My solution adds the overhead ... |
I am developing an application based on Repository design pattern. What should be the return type from the Repository?
This is my UserRepository class:
public class UserRepository : Repository<UserMaster>, IUserRepository
{
public UserRepository(DbContext context)
: base(context)
{
}
public Us... |
Please review my custom ArrayList class I constructed from scratch and add any suggestions or constructive criticisms. The point of this template class is give the user a lightweight ArrayList with optimal control over how it operates.
It is automatically created on the heap with an optional seed value which determines... |
I would like the following code reviewed:
I am trying to create a local server which listens indefinitely and
provides the latest information. The server runs another while loop
which fetches the latest info every one hour.
I have tried
multi-threading approach, in which one thread is a socket server (runs
ind... |
The code is working but slow. Is there a way to speed it up or make it more compact but still easy to read?
There are 35 different jobs to be done. They are made in a worksheet with merged cells to enter, who did the job, when, how long, workorder, nr, etc. Next to the layout is a command button, and when you click on ... |
I made a slide show using array values, it works, but I strongly believe that the way I did is too long.
There should be an easier or more compact way to achieve this.
$(document).ready(function () {
var num = 0;
var myArray = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"];
var batch = 1;... |
I am using the following code to try and only allow letters, numbers, backspace, space, dashes, slashes, and ampersands. I also want all other keys including the function keys (F1, F2, etc) to be disallowed. I feel like this code can be optimized to make it more streamlined.
This function is part of a live search featu... |
I have some code to handle integer, double, Boolean, and string settings. Right now, each setting variant extends an abstract class, where the setting value is stored as an object.
Is there any way to avoid this? What I'd like to do is have IntSetting objects return their Value as an integer, DoubleSetting objects ret... |
I have made a game in Java that involves two players to fight each other with spaceships. For one player mode, I have programmed a simple AI to avoid allies and asteroids and go straight towards the player. Unfortunately, the game lags quite a bit when there are 3 AIs at once. I think this is because of all the for loo... |
I've written a very short program that is intended to run the program specified in its arguments (argv) as the user named "restrict" (which exists). I want to make sure that there are no subtle bugs in the program, and that the program is as simple as possible.
Is this program doing what I intend?
Can someone use this... |
People say that the code in my implementation is generally obscure.
Can you point me what looks bad?
import time
import string
from queue import Queue
from channel import Channel
from client import Client
__author__ = 'mark'
import socket
import connection
from threading import Thread
SPECIAL = "[]\`_^{|}"
ALLOWED_... |
I need to find the common elements present in all the given arrays. All the arrays are present in another array.
I have come up with this solution and it's working. I tried to remove the usage of indexOf, but I could not. Could someone help me optimize this?
var findCommonElements= function(arrs) {
var resArr = [];... |
I recently started to learn Python for the purpose of making my life as a network engineer easier when performing repetitive tasks.
The script below does parse a huge inventory.xml file I get from a reporting tool to find the ID of ports I want it to and then writes back to the XML file a structure representing a cable... |
I'm hoping for someone to help me use the best practices and further make my code better that I used to accomplish the DailyProgrammer Challenge "Balancing Words".
The challenge is to check if a word will "balance" and if it will, where it balances. For a word to balance at a letter, all of the weight to the left and t... |
I keep looking at this trying to figure if there's a better way. All three functions work, but I wanted to get some insights and ideas from others.
IsLoadDay determines if the date parameter is a "Load Day". Load Days are Tuesday through Saturday, but we skip holidays and designated No Load Days. There are two exist... |
I have this code currently written to help me create a menu. I was just wondering if there is a way to tidy this so that there is less code needed to achieve the same thing.
The code is designed to create large dropdowns which have divs inside which will contain most of the content. I want to hide parts of the menu so ... |
I've recently finished implementing a ring queue based on std::array in C++11. I tried to write the code as if I were going to submit it to the C++ Standard committee to have a RingQueue as part of the standard while keeping the implementation as simple and fast as possible. Please let me know if there are any changes ... |
I have a script for a countdown function, which is using massive amounts of CPU power on my MBP.
The script updates the countdown display every second and is updating all piecharts as well.
var options = {
scaleColor: false,
trackColor: 'rgba(255,255,255,0.3)',
barColor: '#E7F7F5',
l... |
See Set-uid root program that runs a program as the user "restrict" for context.
I've written a very short program that is intended to run the program specified in its arguments (argv) as the user named "restrict" (which exists). I want to make sure that there are no subtle bugs in the program, and that the program is ... |
A word is balanced at the index if the sum of the alphabet positions of all the chars multiplied by the distance to the index is zero.
This description is equivalent to the one given by DailyProgrammer in the challenge info.
I did not code Input/Output as I found them not as interesting as the logic.
The code works f... |
I'm writing a plugin and want it to have no dependencies. I create a form and append it to the page, but the code is really long. Does anyone have any suggestions to clean it up, perhaps shortening it? I feel like there must be a better way!
// Create elements
var elements = [
reporter_wrapper = ... |
After a bit of work, I've changed my code a lot from the previous question:
I was recommended by George Mauer and schism to make a better structural design, so hopefully this new build is a bit sleeker in design. I will note that my main target is optimal performance. But like Mr. Mauer said, it is most likely negligi... |
I stumbled upon this exercise , and I am wondering if there is a more efficient way of writing this. It is written from high school level knowledge.
Find the most occuring number of an array of numbers, with each number only counting one per number. For example in 2222 the 2 only counts ONCE. If you have 2 or more dig... |
Unfortunately there is no URL where you can see the code working. I hope you all can figure out what the code does simply by looking at it.
GitHub
var FilteredNav = {
wrapper: $(".dept-filters")
, init: function() {
FilteredNav.changeUrl();
FilteredNav.createUrl();
}
, createUrl:... |
For fun, I have been making a very basic login system in Python. I was going to look up an algorithm or something for user info storage and transfer, but then decided it would be more fun to come up with and implement it myself. What I would like to know is:
Is there anyway to make it secure (i.e.-encrypting the passw... |
Below is my attempt at providing a type-safe way to combine enumeration and bitset together. The resulting class is intended to be use as a set of flags, where each flag is a member of the "user-defined enumeration".
The user must not define any explicit value to the enumeration member.
Below is the "library file" (1 h... |
For practice and to explore my vanilla JavaScript (no-library) weaknesses, yesterday I made a Todo app, similar to what you see floating around for AngularJS blog demos.
How can I optimize this?
// VanillaJS Todo App with full CRUD
(function crudApp() {
"use strict";
// Look ma... no library!
var itemData = {};
... |
I'm using Linq-to-Entities for querying, and MVC.NET and C# for coding. I'm trying to generate monthly donor registry report which needs donor count, donors who signed through web,donors who registered in current month and all this is to be display per county.
private MonthlySummaryViewModel
BuildMonthlySummaryViewMode... |
I have here a snippet of code from a simple video game AI enemy. The basic idea behind the enemy is that he can be in one of a few states. By default he is in a patrolling state, where he moves around at a slow speed to random points within a circle. While in this state, he is rolling every X seconds to switch to on... |
I'm writing my own framework (purely for learning purposes, SPL, OOP, patterns, etc) and have written a class to manage config data throughout the framework (not front end/view, just the core framework).
Example of config data:
The framework requires a specific PHP version to run correctly, and that "required PHP ver... |
I've just edited my .htaccess file. All works as it should, but I'm not too familiar with regular expressions and want to make sure that there aren't any unintended consequences.
I want to:
Add www to the domain if it's not there (i.e. domain.com becomes www.domain.com)
redirect from secondary.primary.com to www.seco... |
I have one input that is needed in many forms, so I created a partial view for that. In the partial view I query the database and generate a drop down list.
I just want to make sure, this is the best way to achieve this.
The partial view looks like this:
@model long?
@{
var data = Utility.GetData();
}
@Html.Drop... |
I'm new to JavaScript and new to jQuery plugin development. My plugin is really easy I just want to taggify a <ul>
(function($) {
var allTags;
$.fn.taggify = function(options) {
allTags = this;
_create(allTags);
return this;
};
function _create(... |
Here I am again; referring to my previous code review request about a self-updating, asynchronous (?) cache.
The previous class takes care of caching operations like "get all users registered in our basecamp company", and updates the list through a getter function, periodically through a TimeSpan parameter supplied at ... |
I have already flunked the test with this code so don't feel bad for cheating any employer. I didn't get any feedback though just wondering what could have gone wrong.
You don't need to get into the functionality, just the overall design. What are short-coming of this code which disqualifies it from being production qu... |
This is a follow-up to yesterday's codereview-question about reading serial data and parsing it.
The code below is run into a seperate thread looped endlessly.
Currently I track the position in my inputBufer manually and copy all bytes which haven't been processed into a new byte-array and assigning that to the old in... |
See the next iteration.
I have this iterative mergesort (a.k.a. bottom-up mergesort).
BottomUpMergesort.java:
package net.coderodde.util.sorting;
import java.util.Arrays;
import java.util.Comparator;
/**
* This class provides static methods for sorting object arrays using
* bottom-up merge sort. The algorithm used... |
My aim is to write a blocking char driver that return to the user space a complete protocol message from the kernel uart driver.
Protocol description
I'm fighting with a very bad protocol, called DMX. Protocol packet is very simple:
start with a break on serial line
first char has to be 0x00
follows 512 bytes
No CRC ... |
I have the following method that will return VariantID for given VariantName ("Name" in db).
To avoid calling my db few thousand times I have dumped all records (~30) to the simple dictionary.
I'm almost certain that this is the correct way of implementing this method but I would like to hear some feedback and any poss... |
Based on input from the UI (most likely a string) I would like to search a list of object and return all object that has one or more matching property values which match the given input.
Do you have any thoughts regarding performance or overall design?
The only requirement is that I need to keep the outer Array.prototy... |
I have some legacy classes written without thread safety in mind. Instances of these classes are now being accessed in a multithreaded context in a thread-un-safe manner. Cue chaos.
To fix this I make a wrapper class that enforces the user to take a transaction lock to serialize access to the instance.
#include <memor... |
Problem
Question taken from here.
I want to go up a flight of stairs that has n steps. I can either take 1 or 2 steps each time. How many different ways can I go up this flight of stairs? Write a function count_stair_ways that solves this problem for me.
def count_stair_ways(n):
Solution:
def count_stair_ways(n):
... |
What I'm trying to achieve here is sort queue of .item-dragable between different lists. Users can click on right and left arrows and items move in queue respectively, where the previous or next item gets placed in place of item that was moved. There is also a placeholder element that should not be counted as a valid s... |
I am a little confused over which layers my filters should be contained in with an n-layer web application.
I've got 4 layers:
Presentation layer
Application layer
Business layer
Infrastructure layer
The Presentation layer can only talk to the Application layer and the Infrastructure layer. The Application layer can ... |
Problem:
Pascal’s triangle is a useful recursive definition that tells us the coefficients in the expansion of the polynomial (x + a)^n. Each element in the triangle has a coordinate, given by the row it is on and its position in the row (which you could call its column). Every number in Pascal’s triangle is defined a... |
Continuation of this question:
I have tried to refactor code according to PEP 8.
I tried to raise some errors instead of just print and sys.exit, as was suggested. (should I define much more exceptions for every function and so, or are general ones enough?)
Code is not complete, there are a few issues I need to look in... |
I am working on to find the kth smallest element in min heap. I have code for this whose complexity is \$O(k \log k)\$. I tried to improve it to \$O(k)\$.
struct heap{
int *array;
int count;
int capacity;
}
intkthsmallestelement(struct heap *h,int i,int k){
if(i<0||i>=h->count)
return IN... |
I have been working the some project and I'm struggling to find the answer. Right now I'm coding with Angular and there some code that makes me write twice. There only two arrays now but if I have lots of arrays the code will be really big. The thing makes me stop always that I have to write the IDs one by one and I co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.