# How is discrete mathematics useful when studying algorithms? \$(function () { var favoriteStarId = "Q" + "37607"; var ExistsUrl = \$("#" + favoriteStarId).attr("ExistsUrl"); var favoriteData = { EntityId: "37607", EntityType: "Q", UserID: "0" } \$.ajax({ type: "POST", url: ExistsUrl, data: JSON.stringify(favoriteData), dataType: "json", contentType: 'application/json; charset=utf-8', success: function (response) { if (response.success == true) { if (response.isExist == true) { \$("#" + favoriteStarId).removeClass('qa-favorite-button'); \$("#" + favoriteStarId).addClass('qa-unfavorite-button'); } else { \$("#" + favoriteStarId).removeClass('qa-unfavorite-button'); \$("#" + favoriteStarId).addClass('qa-favorite-button'); } } } }); \$(".btn-fav").hover(function () { var classes = []; \$('.btn-fav').each(function () { classes.push(\$(this).attr('class')); }); if (classes == "btn-fav qa-favorite-button") { \$('.btn-fav').css("background-color", "#ffab0f"); } else { \$('.btn-fav').css("background-color", "#2f364a"); } \$('.btn-fav').css("background-position", "center bottom"); }, function () { var classes = []; \$('.btn-fav').each(function () { classes.push(\$(this).attr('class')); }); if (classes == "btn-fav qa-favorite-button") { \$('.btn-fav').css("background-color", "#2f364a"); } else { \$('.btn-fav').css("background-color", "#ffaf04"); } \$('.btn-fav').css("background-position", "center bottom"); }); })

163 views
How is discrete mathematics useful when studying algorithms?