עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

++C מימוש קוד הופמן

Featured Replies

פורסם

מנסה לממש קוד הופמן.

בניתי STRUCT TAV


struct tav
{
char val;
int incidence;
tav* right;
tav* left;


tav();
bool operator<(tav &t) const;
bool operator>(tav &t) const;

};

אחרי שאני בונה את העץ, איך אני מקודדת אותו???

זו בניית העץ שעשיתי:



tav x, y, ezer;

while(check()==false)
{
x = heap.RemoveTop();
y = heap.RemoveTop();

ezer.incidence = x.incidence + y.incidence;

ezer.right = new tav(x);
ezer.left = new tav(y);

heap.Insert(ezer);

}

x = heap.RemoveTop();
y = heap.RemoveTop();

ezer.incidence = x.incidence + y.incidence;

ezer.right = new tav(x);
ezer.left = new tav(y);

root = ezer;

(פונקציה CHECK מחזירה FALSE אם נשארו במערך התוים יותר משני תוים)

פורסם
  • מחבר

אולי בכל זאת???

אם אני מוסיפה בSTRUCT לכל משתנה שדה כך שאם הוא בן ימני לאביו הוא יקבל ערך 1 , ואם הוא בן שמאלי הוא יקבל ערך 0.

לאחר בניית העץ אני צריכה לעבור עליו מהשורש ולשרשר את המסלול דרכו אני עוברת עד לעלה <הרי כל התוים הם עלים> איך אני עושה את זה?

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.