[Solved] Push pop stack operation in C [closed]

Here you have again some things wrong. Before you create new threads with similar content, stick to one thread. In your code you also never check if malloc fails. It’s always better to do that. For simplicity I’ve omitted these checks in my suggestions. 1. Why do you do S1[0].top=-1; in makeEmpty? create already does … Read more

[Solved] This code is not working [closed]

Both your snippets are incorrect. You are misusing the post increment operator. if(data[counter]<data[counter++]) will never be true, just like if(data[counter]<data[counter]) will never be true. The post increment operator returns the original value of the incremented variable. It’s not clear why you are incrementing counter in the loop body anyway. You should only increment it in … Read more

[Solved] Getting all the values from an array in between a range

Loop through your array and check if the number is within the given range (min number for example is nine and max number is 30). Add it to a newly created array then return the array when you’re done. I’ll provide a code snipit shortly. public ArrayList<Integer> withinRange(int min, int max, int[]array){ ArrayList<Integer> list = … Read more

[Solved] Multiple Array puzzle

using combination of array_map, array_column and array_reverse : $myArrays = array( array(1, 2, 3, 4), array(5, 6, 7, 8), array(9, 10, 11, 12), array(13, 14, 15, 16) ); $index = 0; $myArrays = array_map(function ($v) use (&$index, $myArrays) { if (($index % 2) != 0) { echo implode(“\n”, array_reverse(array_column($myArrays, $index))) . “\n”; } else { … Read more

[Solved] Object Array Initialization [duplicate]

Variables and array elements are all references to objects. They are not the actual objects. To illustrate, I’ll “name” actual objects using a number scheme, e.g. #1 is the first object. Your code runs as follows: Class is initialized by the JVM, and root1, root2, and root3 are all null. Node root[]={root1,root2,root3} is executed and … Read more

[Solved] How to echo values from this array? [duplicate]

You can foreach to loop through all item and call in the array like: foreach($yourArray as $item) { echo $item->label; echo $item->file; } Or you can be using json_decode to cast your object to the array. $result = json_decode($data, true); 2 solved How to echo values from this array? [duplicate]

[Solved] How can I read this unstructured flat file in Java?

Consider this file divided in middle present two record in same format, you need to design class that contains fields that you want to get from this file. After that you need to read List<String> fileLines = Files.readAllLines(Path pathToYourFile, Charset cs); and parse this file with help of regular expressions. To simplify this task you … Read more