Questions tagged [reversing]

Reversing refers to performing a task in the direction opposite to that which the task is normally performed in. It also refers to changing the order of an ordered list of items such that they are rearranged from the last item to the first item. For questions related to discovering the principles of a human made system through analysis, please use [tag:reverse-engineering].

Reversing refers to performing a task in the direction opposite to that which the task is normally performed in.

It also refers to changing the order of an ordered list of items such that they are rearranged from the last item to the first item.

For questions related to discovering the principles of a human made system through analysis, please use .

113 questions
0
votes
2 answers

Reversing digits in Java. Leading and trailing zeros won't print

The problem was to reverse user entered digits. I have it working but while testing it I realized that it won't print either leading or trailing zeros. For example if I enter 10 it only displays 1 in the result. If I enter 0110 I get a result of…
Mac
  • 375
  • 6
  • 10
  • 17
0
votes
1 answer

Assembly language--How to reverse string by using STOSB and LODSB?

StrReverse proc uses ecx eax edi esi, StrAdd1:dword, ;string 1 address StrAdd2:dword ;string 2 address std ;backward direction - set direction flag push…
Z Feng
  • 13
  • 1
  • 4
0
votes
3 answers

Reversing stdin in C

I need some advice on how to reverse the contents of stdin. This is the part of my code which handles reversing stdin: int reversestdin(FILE *file) { int a, b; int lineas=0; while ((a=fgetc(stdin)) !=EOF) { if (a=='\n') …
hugo19941994
  • 10,942
  • 3
  • 17
  • 13
0
votes
1 answer

byte reverse hex with python

I have a .bin file, and I want to simply byte reverse the hex data. Say for instance @ 0x10 it reads AD DE DE C0, want it to read DE AD C0 DE. I know there is a simple way to do this, but I am am beginner and just learning python and am trying to…
james28909
  • 554
  • 2
  • 9
  • 20
-1
votes
2 answers

In this reverse range loop exercise not sure why the stop value is -1, shouldn't it be 0 in this start,stop,step range reverse exercise

string = input("Enter a string: ") for i in range(len(string)-1, -1, -1): print(string[i], end="") I am confused in this start, stop, step not sure why it is -1 in the stop bit - I tried putting 0.
noob
  • 11
  • 1
-1
votes
1 answer

prog.java:52: error: incompatible types: int cannot be converted to boolean for(int i=0;i=n/2;i++){

Does values in for loop gives boolean results in Java? Getting this error when I compiled the code: prog.java:52: error: incompatible types: int cannot be converted to boolean for(int i=0;i=n/2;i++){ public static void reverseArray(int arr[], int…
Tripti Verma
  • 1
  • 1
  • 5
-1
votes
1 answer

Assigning value only works outside the loop

I am learning CPP (first language) and I am trying to reverse a linked list. this code is not working node* reverse(node** head){ node* previous=NULL; node* current=*head; node* nextptr=current->next; while(current!=NULL){ …
-1
votes
1 answer

My program is working properly but still at the end its showing Segmentation fault

gdb already Tried :0 void Reverse(struct Array *arr) { int i, j; for (i = 0, j = arr->length - 1; i < j; i++, j--) { swap(&arr->arr[i], &arr->arr[j]); } } void Reverse2(struct Array *obj) { int *b; int i, j; b…
ullas kunder
  • 3
  • 1
  • 3
-1
votes
1 answer

Reversing C++ foo(MyClass &) vs foo(const MyClass &)

Suppose I want to reverse some binary, will I be able to tell the difference between: int foo(MyClass &) { ... } and int foo(const MyClass &) { ... } Assuming the code compiled fine, there would be no evidence of the const qualifier whatsoever,…
OrenIshShalom
  • 5,974
  • 9
  • 37
  • 87
-1
votes
3 answers

array elements in python

I'm new to python and am wondering about counting down values of an array in reverse: a = [1, 2, 3, 4] def countdown_reversed(lists): for x in reversed(lists): print(x) # why is it x and not lists[x]? countdown_reversed(list)
devdropper87
  • 4,025
  • 11
  • 44
  • 70
-1
votes
2 answers

returning the list reversed

i have this question: Write a function reverse3(nums) that takes a list of ints of length 3 called nums and returns a new list with the elements in reverse order, so [1, 2, 3] becomes [3, 2, 1]. i solved it by: def reverse3(nums): return…
Moh'd H
  • 247
  • 1
  • 4
  • 16
-2
votes
1 answer

Why is the time limit exceeding in reversing the linked list?

# Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]: …
-2
votes
1 answer

Recursive Java method does not fully execute

Trying to implement an algorithm with Java where the method will take an input array, starting index and ending index, and will recursively reverse the array with a swap function. The method will properly swap the base case, but it will return that…
-2
votes
1 answer

Print [Ljava.lang.String; list from frida

how can i print list of strings ([Ljava.lang.String;) from java in frida? I tried different methods but nothing works for me: Java.use('java.util.Arrays').toString(arr) Java.array("java.lang.String",arr); JSON.stringify(arr)
LeaksKurs
  • 21
  • 2
-2
votes
1 answer

How to reverse a string in python?

p_phrase = "was it a car or a cat I saw" p = p_phrase.split() p.reverse() print(p_phrase) r_phrase = "" for words in p: if p_phrase != r_phrase + words[:-1]+"": print(r_phrase) I wrote the following code to…